Skip to content

Commit 96af7ec

Browse files
authored
Update Windows Install Path (#28)
1 parent 1bbd095 commit 96af7ec

5 files changed

Lines changed: 29 additions & 15 deletions

File tree

Taskfile.yml

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,17 @@ version: "3"
44
env:
55
CGO_ENABLED: 0
66

7+
vars:
8+
EXE: ir
9+
710
tasks:
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

assets/main.tape

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ Type "which bup"
3131
Sleep 0.5s
3232
Enter
3333
Wait
34-
Sleep 1.5s
34+
Sleep 1s
3535

3636
Type "bup -V"
3737
Sleep 0.5s
3838
Enter
3939
Wait
40-
Sleep 1.5s
40+
Sleep 1s
4141

4242
Type "ir list"
4343
Sleep 0.5s

cmd/config.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff 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
}

cmd/root.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ import (
99
"path/filepath"
1010
)
1111

12-
var verbose int
12+
var (
13+
verbose int
14+
)
1315

1416
var 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)

installer.iss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#define MyAppVersion "0.0.1"
77
#endif
88
#define MyAppFileName "ir"
9+
#define MyDefaultDirName "install-release"
910

1011
[Setup]
1112
AppId={{77FFF241-28DE-450E-AE6F-00CD662B8DE3}
@@ -18,7 +19,7 @@ AppSupportURL={#MyAppURL}
1819
AppUpdatesURL={#MyAppURL}
1920
;Compression=lzma
2021
;SolidCompression=yes
21-
DefaultDirName={autopf}\{#MyAppName}
22+
DefaultDirName={autopf}\{#MyDefaultDirName}
2223
DefaultGroupName={#MyAppName}
2324
;DisableDirPage=yes
2425
;DisableProgramGroupPage=yes

0 commit comments

Comments
 (0)