File tree Expand file tree Collapse file tree 1 file changed +3
-8
lines changed
Expand file tree Collapse file tree 1 file changed +3
-8
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,9 @@ def Go::go(command, options={})
2222 opts = { :use_hashbang => false , :version_args => [ 'version' ] , :version_regex => /\A go version (.*)/ }
2323 opts [ :verb ] = options [ :verb ] if options [ :verb ]
2424
25+ # Default to running against directory, which in go should be the package.
26+ # Doesn't hold for "go run", which needs to be executed against the file.
27+ # The same will happend if directory is not set.
2528 directory = ENV [ 'TM_DIRECTORY' ]
2629 if directory
2730 opts [ :chdir ] = directory
@@ -30,14 +33,7 @@ def Go::go(command, options={})
3033 if command == 'run' || !directory
3134 args . push ( ENV [ 'TM_FILEPATH' ] )
3235 else
33- # Default to running against directory, which in go should be the package
34- # Useful for more cases, like install and build
35- # Assumes a standard setup and may not function with all pkg managers
36- opts [ :chdir ] = ENV [ 'TM_DIRECTORY' ]
37- pkg_length = ENV [ 'GOPATH' ] . length + 4 # GOPATH + /src/
38- go_pkg = ENV [ 'TM_DIRECTORY' ] [ pkg_length ..-1 ] # subtract above, is pkg name
3936 args . push ( "-v" ) # list packages being operated on
40- args . push ( go_pkg )
4137 end
4238 args . push ( opts )
4339
@@ -96,4 +92,3 @@ def Go::gofmt
9692 end
9793 end
9894end
99-
You can’t perform that action at this time.
0 commit comments