Fixed touch error
This commit is contained in:
parent
990978f157
commit
b1b9854a6d
@ -9,7 +9,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func Touch(in input_parser.Input, env *environment.Env) {
|
func Touch(in input_parser.Input, env *environment.Env) {
|
||||||
file_path := filepath.Join(env.Path, in.Args_raw)
|
file_path := filepath.Join(env.Path, in.Args[0])
|
||||||
_, err := os.Stat(file_path)
|
_, err := os.Stat(file_path)
|
||||||
if !os.IsNotExist(err) {
|
if !os.IsNotExist(err) {
|
||||||
fmt.Print(fmt.Sprintf("File alredy exist!"))
|
fmt.Print(fmt.Sprintf("File alredy exist!"))
|
||||||
@ -22,6 +22,3 @@ func Touch(in input_parser.Input, env *environment.Env) {
|
|||||||
}
|
}
|
||||||
defer file.Close()
|
defer file.Close()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user