Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf72ae9f

Browse files
authored
Fix/alfred link (#3)
* fix(alfred): ln -s buildDir target* fix(template): cmd/root.go
1 parent81f1d36 commitf72ae9f

File tree

3 files changed

+29
-28
lines changed

3 files changed

+29
-28
lines changed

‎alfred/alfred.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -246,9 +246,8 @@ func (a *Alfred) Link() error {
246246
uuid:=strings.TrimSpace(string(uuidgen))
247247
target:=path.Join(a.WorkflowsPath,"user.workflow."+string(uuid))
248248
logrus.Printf("Creating new link to target %s",target)
249-
buildPath:=path.Join(a.WorkflowPath,a.BuildDir)
250-
logrus.Printf("Build path is %s",buildPath)
251-
Run("ln","-s",buildPath,target)
249+
logrus.Printf("Build path is %s",a.BuildDir)
250+
Run("ln","-s",a.BuildDir,target)
252251
logrus.Println("created link",filepath.Base(target))
253252

254253
returnnil

‎templates/bindata.go

Lines changed: 14 additions & 14 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎templates/tmpl/scriptFilter.root.tmpl

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,20 @@ package cmd
55

66
import (
77
"log"
8-
"os"
9-
"os/exec"
8+
"os"{{if .EnabledAutoUpdate}}"
9+
"os/exec"{{end}}
1010

1111
aw "github.com/deanishe/awgo"
1212
"github.com/deanishe/awgo/update"
1313
"github.com/spf13/cobra"
1414
)
15-
16-
{{if .EnabledAutoUpdate}}const updateJobName = "checkForUpdate"{{end}}
17-
15+
{{if .EnabledAutoUpdate}}const updateJobName = "checkForUpdate"
1816
var (
19-
repo = "{{.GithubRepo}}"
17+
repo = "xxx/ak-test"
2018
wf *aw.Workflow
2119
)
2220

23-
{{if .EnabledAutoUpdate}}func CheckForUpdate() {
21+
func CheckForUpdate() {
2422
if wf.UpdateCheckDue() && !wf.IsRunning(updateJobName) {
2523
log.Println("Running update check in background...")
2624
cmd := exec.Command(os.Args[0], "update")
@@ -37,15 +35,19 @@ var (
3735
Autocomplete("workflow:update").
3836
Icon(&aw.Icon{Value: "update-available.png"})
3937
}
40-
}{{end}}
41-
38+
}{{else}}
39+
var (
40+
repo = "xxx/ak-test"
41+
wf *aw.Workflow
42+
)
43+
{{end}}
4244
// rootCmd represents the base command when called without any subcommands
4345
var rootCmd = &cobra.Command{
4446
Use: "{{.Name}}",
4547
Short: "{{.Description}}",
4648
Run: func(cmd *cobra.Command, args []string) {
47-
{{if .EnabledAutoUpdate}}CheckForUpdate(){{end}}
48-
wf.SendFeedback()
49+
{{if .EnabledAutoUpdate}}CheckForUpdate()
50+
wf.SendFeedback(){{else}}wf.SendFeedback(){{end}}
4951
},
5052
}
5153

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp