File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,12 +4,17 @@ version: "3"
44env :
55 CGO_ENABLED : 0
66
7+ vars :
8+ EXE : ir
9+
710tasks :
8- goup :
9- aliases : [go, tidy]
10- cmd : |
11- go get -u
12- go mod tidy
11+ tidy :
12+ cmd : go mod tidy
13+
14+ go :
15+ cmds :
16+ - go get -u
17+ - task : tidy
1318
1419 lint :
1520 desc : Lint
@@ -48,19 +53,21 @@ tasks:
4853
4954 pathmgr :
5055 desc : Download PathMgr
51- if : test ! -d dist/PathMgr
56+ status : [ test ! -d dist/PathMgr]
5257 cmd : |
5358 mkdir -p dist
5459 wget https://github.com/Bill-Stewart/PathMgr/releases/download/v2.0.0/PathMgr-2.0.0.zip -O dist/pathmgr.zip
5560 unzip dist/pathmgr.zip -d dist/PathMgr
5661
5762 install :
5863 vars :
59- SOURCE_NAME : install-release
60- TARGET_NAME : ir
64+ TARGET_NAME : ' {{.EXE}}{{if eq OS "windows"}}.exe{{end}} '
65+ TARGET_DIR : ' ${HOME}{{if eq OS "windows"}}\bin\{{else}}/bin/{{end}}{{.TARGET_NAME}} '
6166 cmd : |
62- go build
63- mv -f {{.SOURCE_NAME}} "${HOME}/bin/{{.TARGET_NAME}}"
67+ go build -o {{.TARGET_NAME}}
68+ echo "Name: {{.TARGET_NAME}}"
69+ mv "{{.TARGET_NAME}}" "{{.TARGET_DIR}}"
70+ echo "Path: {{.TARGET_DIR}}"
6471 which {{.TARGET_NAME}}
6572 {{.TARGET_NAME}} -V
6673
Original file line number Diff line number Diff line change @@ -31,13 +31,13 @@ Type "which bup"
3131Sleep 0.5s
3232Enter
3333Wait
34- Sleep 1.5s
34+ Sleep 1s
3535
3636Type "bup -V"
3737Sleep 0.5s
3838Enter
3939Wait
40- Sleep 1.5s
40+ Sleep 1s
4141
4242Type "ir list"
4343Sleep 0.5s
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ var configCmd = &cobra.Command{
2020 file := viper .ConfigFileUsed ()
2121 log .Infof ("viper.ConfigFileUsed(): %v" , file )
2222 edit := editor .NewEditor ()
23+ styles .PrintKV ("Opening" , file )
2324 if err := edit .Launch (file ); err != nil {
2425 log .Fatal (err )
2526 }
Original file line number Diff line number Diff line change 99 "path/filepath"
1010)
1111
12- var verbose int
12+ var (
13+ verbose int
14+ )
1315
1416var rootCmd = & cobra.Command {
1517 Use : "ir owner/repo [tag]" ,
@@ -51,17 +53,20 @@ func onInitialize() {
5153
5254 configName := "install-release"
5355 //viper.SetEnvPrefix("ir")
54- viper .SetConfigType ("yaml" )
5556 viper .SetConfigName (configName )
57+ viper .SetConfigType ("yaml" )
58+
5659 homeDir , err := os .UserHomeDir ()
5760 if err != nil {
5861 log .Warnf ("os.UserHomeDir err: %v" , err )
5962 homeDir = "."
6063 }
6164 log .Debugf ("homeDir: %v" , homeDir )
65+
6266 configPath := filepath .Join (homeDir , ".config" )
6367 log .Debugf ("configPath: %v" , configPath )
6468 viper .AddConfigPath (configPath )
69+
6570 defaultBinPath := filepath .Join (homeDir , "bin" )
6671 log .Debugf ("defaultBinPath: %v" , defaultBinPath )
6772 viper .SetDefault ("bin" , defaultBinPath )
Original file line number Diff line number Diff line change 66 #define MyAppVersion " 0.0.1"
77#endif
88#define MyAppFileName " ir"
9+ #define MyDefaultDirName " install-release"
910
1011[Setup]
1112AppId = {{77FFF241-28DE-450E-AE6F-00CD662B8DE3}
@@ -18,7 +19,7 @@ AppSupportURL={#MyAppURL}
1819AppUpdatesURL = {#MyAppURL}
1920;Compression=lzma
2021;SolidCompression=yes
21- DefaultDirName = {autopf}\{#MyAppName }
22+ DefaultDirName = {autopf}\{#MyDefaultDirName }
2223DefaultGroupName = {#MyAppName }
2324;DisableDirPage=yes
2425;DisableProgramGroupPage=yes
You can’t perform that action at this time.
0 commit comments