diff --git a/.gitattributes b/.gitattributes old mode 100755 new mode 100644 diff --git a/README.md b/README.md index 5a68b00..5317e5b 100644 --- a/README.md +++ b/README.md @@ -82,7 +82,7 @@ tran sync start ### Tran Config file -> tran config file is located at `~/.config/tran/tran.yml` | `$HOME/tran.yml` +> tran config file is located at `~/.tran/tran.yml` ```yml config: diff --git a/app/checker/checker.go b/app/checker/checker.go old mode 100755 new mode 100644 diff --git a/app/config/config.go b/app/config/config.go old mode 100755 new mode 100644 index 134ea3b..b95720b --- a/app/config/config.go +++ b/app/config/config.go @@ -14,7 +14,7 @@ import ( var ( homeDir, _ = dfs.GetHomeDirectory() - tranConfigPath = filepath.Join(homeDir, ".config", "tran", "tran.yml") + tranConfigPath = filepath.Join(homeDir, ".tran", "tran.yml") tranConfig, err = ioutil.ReadFile(tranConfigPath) ) diff --git a/app/sync.go b/app/sync.go index 89c559e..e49fe97 100644 --- a/app/sync.go +++ b/app/sync.go @@ -25,7 +25,7 @@ var ( Short: "Start sync your tran config.", Run: func(cmd *cobra.Command, args []string) { if username != ":username" { - exCmd := "echo '# My tran config - " + username + "\n\n## Clone\n\n```\ntran sync clone\n```\n\n**for more about sync command, run `tran sync -h`**' >> $HOME/.config/tran/README.md" + exCmd := "echo '# My tran config - " + username + "\n\n## Clone\n\n```\ntran sync clone\n```\n\n**for more about sync command, run `tran sync -h`**' >> $HOME/.tran/README.md" gosh.Run(exCmd) gosh.RunMulti(constants.Start_ml(), constants.Start_w()) @@ -134,7 +134,7 @@ func PushSync() { if runtime.GOOS == "windows" { err, out, errout := gosh.PowershellOutput( ` - $directoyPath = "~/.config/tran/.git" + $directoyPath = "~/.tran/.git" if (Test-Path -path $directoyPath) { Write-Host "Reading from .tran folder..." @@ -158,7 +158,7 @@ func PushSync() { } else { err, out, errout := gosh.ShellOutput( ` - if [ -d ~/.config/tran/.git ]; then + if [ -d ~/.tran/.git ]; then echo "📖 Reading from .tran folder..." fi `) diff --git a/cmd/factory/default.go b/cmd/factory/default.go old mode 100755 new mode 100644 diff --git a/cmd/tran/help-topic.go b/cmd/tran/help-topic.go old mode 100755 new mode 100644 diff --git a/cmd/tran/help.go b/cmd/tran/help.go old mode 100755 new mode 100644 diff --git a/cmd/tran/root.go b/cmd/tran/root.go old mode 100755 new mode 100644 diff --git a/constants/commands.go b/constants/commands.go index 7c6ab11..a79d330 100644 --- a/constants/commands.go +++ b/constants/commands.go @@ -2,7 +2,7 @@ package constants func Fetch_w() string { return ` - Remove-Item $HOME\.config\tran -Recurse -Force + Remove-Item $HOME\.tran -Recurse -Force tran sync fetchx Write-Host "Fetched Successfully" ` @@ -10,7 +10,7 @@ func Fetch_w() string { func Fetch_ml() string { return ` - cd $HOME/.config/tran + cd $HOME/.tran git pull echo "Fetched Successfully ✅" ` @@ -19,7 +19,7 @@ func Fetch_ml() string { func Start_w() string { return ` $username = tran auth get-username - cd $HOME\.config\tran + cd $HOME\.tran git init tran gh-repo create .tran -d "My tran config - $username" --private -y git add . @@ -34,7 +34,7 @@ func Start_w() string { func Start_ml() string { return ` username=$(tran auth get-username) - cd ~/.config/tran + cd ~/.tran git init tran gh-repo create .tran -d "My tran config - $username" --private -y git add . @@ -48,7 +48,7 @@ func Start_ml() string { func Push_w() string { return ` $lastDir = pwd - cd $HOME\.config\tran + cd $HOME\.tran if (Test-Path -path .git) { git add . git commit -m "new change" @@ -61,7 +61,7 @@ func Push_w() string { func Push_ml() string { return ` - cd ~/.config/tran + cd ~/.tran git add . git commit -m "new tran config" git push @@ -71,7 +71,7 @@ func Push_ml() string { func Pull_w() string { return ` $lastDir = pwd - cd $HOME\.config\tran + cd $HOME\.tran git pull @@ -81,14 +81,14 @@ func Pull_w() string { func Pull_ml() string { return ` - cd ~/.config/tran + cd ~/.tran git pull ` } func Clone_w() string { return ` - $TRANDIR = $HOME\.config\tran + $TRANDIR = $HOME\.tran if (Test-Path -path $TRANDIR) { Remove-Item $TRANDIR -Recurse -Force @@ -100,7 +100,7 @@ func Clone_w() string { func Clone_ml() string { return ` - TRANDIR=~/.config/tran + TRANDIR=~/.tran if [ -d $TRANDIR ]; then rm -rf $TRANDIR @@ -112,12 +112,12 @@ func Clone_ml() string { func Clone_check_w() string { return ` - if (Test-Path -path $HOME\.config\tran) { + if (Test-Path -path $HOME\.tran) { Write-Host "tran repo cloned successfully" } ` } func Clone_check_ml() string { - return `if [ -d $HOME/.config/tran ]; then echo "tran repo cloned successfully ✅"; fi` + return `if [ -d $HOME/.tran ]; then echo "tran repo cloned successfully ✅"; fi` } diff --git a/core/tranx/id.go b/core/tranx/id.go old mode 100755 new mode 100644 diff --git a/internal/config/config.go b/internal/config/config.go index 96275b0..1a05d15 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -34,7 +34,7 @@ func defualtEditor() string { } // LoadConfig loads a users config and creates the config if it does not exist -// located at `~/.config/tran.yml` +// located at `~/.tran/tran.yml` func LoadConfig(startDir *pflag.Flag) { var err error @@ -44,12 +44,17 @@ func LoadConfig(startDir *pflag.Flag) { log.Fatal(err) } - err = dfs.CreateDirectory(filepath.Join(homeDir, ".config", "tran")) + err = dfs.CreateDirectory(filepath.Join(homeDir, ".tran")) if err != nil { log.Fatal(err) } - viper.AddConfigPath("$HOME/.config/tran") + viper.AddConfigPath("$HOME/.tran") + + if runtime.GOOS == "windows" { + viper.AddConfigPath(`$USERPROFILE\\.tran`) + } + viper.SetConfigName("tran") viper.SetConfigType("yml") diff --git a/internal/tui/receive.go b/internal/tui/receive.go old mode 100755 new mode 100644 diff --git a/internal/tui/send.go b/internal/tui/send.go old mode 100755 new mode 100644 diff --git a/ios/color.go b/ios/color.go old mode 100755 new mode 100644 diff --git a/ios/console.go b/ios/console.go old mode 100755 new mode 100644 diff --git a/ios/console_windows.go b/ios/console_windows.go old mode 100755 new mode 100644 diff --git a/ios/iostreams.go b/ios/iostreams.go old mode 100755 new mode 100644 diff --git a/ios/tty_size.go b/ios/tty_size.go old mode 100755 new mode 100644 diff --git a/ios/tty_size_windows.go b/ios/tty_size_windows.go old mode 100755 new mode 100644 diff --git a/models/model.go b/models/model.go old mode 100755 new mode 100644 diff --git a/scripts/bfs.ps1 b/scripts/bfs.ps1 old mode 100755 new mode 100644 diff --git a/scripts/tag.sh b/scripts/tag.sh old mode 100755 new mode 100644 diff --git a/tools/errors.go b/tools/errors.go old mode 100755 new mode 100644 diff --git a/tools/text.go b/tools/text.go old mode 100755 new mode 100644