Skip to content

Commit

Permalink
VERSION v1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
lnxwizard committed Apr 30, 2023
1 parent 9055b29 commit 967a2ad
Show file tree
Hide file tree
Showing 8 changed files with 73 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/bin
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
run/touch:
go run cmd/touch/main.go

clean:
go clean
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# What is touch?
The touch is a standard command used in the UNIX/Linux operating system to create files for windows. I decided to make this software because there is no touch command in Windows operating systems.

# How to Use?
```
touch fileName
```
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
touch1.0.0
16 changes: 16 additions & 0 deletions cmd/touch/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package main

import (
"fmt"
"os"

"github.com/AlperAkca79/touch/internal/touch"
)

func main() {
if len(os.Args) != 2 {
fmt.Println("Usage: touch fileName")
} else {
touch.CreateFile(os.Args[1])
}
}
10 changes: 10 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module github.com/AlperAkca79/touch

go 1.20

require (
github.com/fatih/color v1.15.0
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.17 // indirect
golang.org/x/sys v0.6.0 // indirect
)
10 changes: 10 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs=
github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw=
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng=
github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
23 changes: 23 additions & 0 deletions internal/touch/touch.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package touch

import (
"fmt"
"os"

"github.com/fatih/color"
)

func CreateFile(fileName string) {
// create file
os.Create(fileName)

// set foreground green
color.Set(color.FgGreen)

fmt.Print("Touching ")

// unset foreground color
color.Unset()

fmt.Println(fileName)
}

0 comments on commit 967a2ad

Please sign in to comment.