Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
- Different JSON library that handles comments better
- Update AwGo for PrettyPath fix
- Also expand ~ and envvars in exclude globs
  • Loading branch information
deanishe committed Nov 15, 2021
1 parent 94379bc commit 791c2df
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 14 deletions.
Binary file modified Alfred Sublime Text.afdesign
Binary file not shown.
6 changes: 6 additions & 0 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,17 @@ func loadConfig(path string) (*config, error) {
if conf.Depth == 0 {
conf.Depth = DefaultDepth
}
for i, s := range conf.Excludes {
conf.Excludes[i] = expandPath(s)
}
for _, sp := range conf.SearchPaths {
if sp.Depth == 0 {
sp.Depth = conf.Depth
}
sp.Path = expandPath(sp.Path)
for i, s := range sp.Excludes {
sp.Excludes[i] = expandPath(s)
}
}

return conf, nil
Expand Down
5 changes: 2 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ go 1.13
require (
github.com/BurntSushi/toml v0.3.1
github.com/davecgh/go-spew v1.1.1
github.com/deanishe/awgo v0.29.0
github.com/deanishe/awgo v0.29.1
github.com/gobwas/glob v0.2.3
github.com/magefile/mage v1.11.0
github.com/yosuke-furukawa/json5 v0.1.1
github.com/tidwall/jsonc v0.3.2
)

8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ3
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/deanishe/awgo v0.29.0 h1:mx8cNHTv2siGEbgKSlFXG8pJhE6lvQE5hY9t8ddxjzQ=
github.com/deanishe/awgo v0.29.0/go.mod h1:1yGF+uQfWXX99TiDfAYYKjJpHTq5lHEmvHFEVCHo6KA=
github.com/deanishe/awgo v0.29.1 h1:yKAyy0e+HR60iPxaKHhY3hdTM5GCsECpWTP79j04bHg=
github.com/deanishe/awgo v0.29.1/go.mod h1:1yGF+uQfWXX99TiDfAYYKjJpHTq5lHEmvHFEVCHo6KA=
github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y=
github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8=
github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
Expand All @@ -28,8 +28,8 @@ github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81P
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/yosuke-furukawa/json5 v0.1.1 h1:0F9mNwTvOuDNH243hoPqvf+dxa5QsKnZzU20uNsh3ZI=
github.com/yosuke-furukawa/json5 v0.1.1/go.mod h1:sw49aWDqNdRJ6DYUtIQiaA3xyj2IL9tjeNYmX2ixwcU=
github.com/tidwall/jsonc v0.3.2 h1:ZTKrmejRlAJYdn0kcaFqRAKlxxFIC21pYq8vLa4p2Wc=
github.com/tidwall/jsonc v0.3.2/go.mod h1:dw+3CIxqHi+t8eFSpzzMlcVYxKp08UP5CD8/uSFCyJE=
go.deanishe.net/env v0.5.1 h1:WiOncK5uJj8Um57Vj2dc1bq1lMN7fgRag9up7I3LZy0=
go.deanishe.net/env v0.5.1/go.mod h1:ihEYfDm0K0hq3f5ACTCQDrMTWxH9fTiA1lh1i0aMqm0=
go.deanishe.net/fuzzy v1.0.0 h1:3Qp6PCX0DLb9z03b5OHwAGsbRSkgJpSLncsiDdXDt4Y=
Expand Down
8 changes: 4 additions & 4 deletions info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ fi</string>
/------------- ACTION IN -------------\
query={query}
variables={allvars}
\------------- ACTION OUT ------------/</string>
\------------- ACTION IN -------------/</string>
<key>cleardebuggertext</key>
<false/>
<key>processoutputs</key>
Expand Down Expand Up @@ -802,9 +802,9 @@ variables={allvars}
<integer>0</integer>
<key>relatedApps</key>
<array>
<string>com.runningwithcrayons.Alfred-Preferences</string>
<string>com.cocoatech.PathFinder</string>
<string>com.sublimetext.4</string>
<string>com.cocoatech.PathFinder</string>
<string>com.runningwithcrayons.Alfred-Preferences</string>
<string>com.apple.finder</string>
</array>
<key>relatedAppsMode</key>
Expand Down Expand Up @@ -1048,7 +1048,7 @@ To add additional directories to scan, use `.stconfig &gt; Edit Config File`.</s
<string>VSCODE</string>
</array>
<key>version</key>
<string>3.3.0-beta</string>
<string>3.3.0-beta2</string>
<key>webaddress</key>
<string>https://github.com/deanishe/alfred-sublime-text</string>
</dict>
Expand Down
5 changes: 3 additions & 2 deletions project.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@
package main

import (
"encoding/json"
"io/ioutil"
"path/filepath"
"strings"

// Supports comments in JSON, which is required to read
// Sublime Text or VS Code project files.
json "github.com/yosuke-furukawa/json5/encoding/json5"
"github.com/tidwall/jsonc"
)

// Project is a Sublime Text or VS Code project.
Expand Down Expand Up @@ -70,7 +71,7 @@ func NewProject(path string) (Project, error) {
return proj, err
}

if err = json.Unmarshal(data, &raw); err == nil {
if err = json.Unmarshal(jsonc.ToJSON(data), &raw); err == nil {
proj.Folders = []string{}
for _, f := range raw.Folders {
if p := resolvePath(dir, f.Path); p != "" {
Expand Down
2 changes: 1 addition & 1 deletion scan.go
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ func filterExcludes(in <-chan string, patterns []string) <-chan string {
return filterMatches(in, func(r string) bool {
for _, g := range globs {
if g.Match(r) {
log.Printf("[filter] ignored (%s): %s", g, util.PrettyPath(r))
log.Printf("[filter] ignored (%v): %s", g, util.PrettyPath(r))
return true
}
}
Expand Down

0 comments on commit 791c2df

Please sign in to comment.