Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions gosubl/sh.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,17 @@ def env(m={}):
e.update(_env_ext)
e.update(m)

fn = gs.attr('active_fn', '')
wd = gs.getwd()

e.update({
'PWD': wd,
'_wd': wd,
'_fn': fn,
'_vfn': gs.attr('active_vfn', ''),
'_nm': fn.replace('\\', '/').split('/')[-1],
})

roots = [os.path.normpath(s) for s in gs.lst(e.get('GOPATH', '').split(psep), e.get('GOROOT', ''))]
e['GS_GOPATH'] = gs_gopath(gs.getwd(), roots) or gs_gopath(gs.attr('last_active_go_fn', ''), roots)

Expand Down Expand Up @@ -347,17 +358,6 @@ def env(m={}):

e['PATH'] = psep.join(add_path)

fn = gs.attr('active_fn', '')
wd = gs.getwd()

e.update({
'PWD': wd,
'_wd': wd,
'_fn': fn,
'_vfn': gs.attr('active_vfn', ''),
'_nm': fn.replace('\\', '/').split('/')[-1],
})

# Ensure no unicode objects leak through. The reason is twofold:
# * On Windows, Python 2.6 (used by Sublime Text) subprocess.Popen
# can only take bytestrings as environment variables in the
Expand Down