Skip to content
This repository has been archived by the owner on Jan 10, 2023. It is now read-only.

Commit

Permalink
fix errors when windows env vars dont exist
Browse files Browse the repository at this point in the history
  • Loading branch information
joshrowley committed Dec 7, 2016
1 parent 0d0a140 commit 4ff60fb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions lib/windows.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
isWindows = process.platform == 'win32'
return if !isWindows

installLocationX86 = path.join(process.env['ProgramFiles(x86)'], 'Learn IDE')
installLocation = path.join(process.env['ProgramFiles'], 'Learn IDE')
installLocationX86 = path.join((process.env['ProgramFiles(x86)'] || ''), 'Learn IDE')
installLocation = path.join((process.env['ProgramFiles'] || ''), 'Learn IDE')

if (fs.existsSync(installLocationX86) || fs.existsSync(installLocation))
alert("You appear to have two versions of the Learn IDE installed. This happens when upgrading from v1.9 to v2 on Windows. Please uninstall v1.9 by following the instructions in the help article that opens when you close this alert.")
shell.openExternal('https://theflatironschool.zendesk.com/hc/en-us/articles/235711268')

v1InitFile = path.join(atom.getConfigDirPath(), 'ide-init.coffee')
v1InitFile = path.join((atom.getConfigDirPath() || ''), 'ide-init.coffee')
if fs.existsSync(v1InitFile)
contents = fs.readFileSync(v1InitFile, 'utf8')
return if contents.indexOf(id) > -1
Expand Down
6 changes: 3 additions & 3 deletions lib/windows_code.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
isWindows = process.platform == 'win32'
return if !isWindows

installLocationX86 = path.join(process.env['ProgramFiles(x86)'], 'Learn IDE')
installLocation = path.join(process.env['ProgramFiles'], 'Learn IDE')
installLocationX86 = path.join((process.env['ProgramFiles(x86)'] || ''), 'Learn IDE')
installLocation = path.join((process.env['ProgramFiles'] || ''), 'Learn IDE')

if (fs.existsSync(installLocationX86) || fs.existsSync(installLocation))
alert("You appear to have two versions of the Learn IDE installed. This happens when upgrading from v1.9 to v2 on Windows. Please uninstall v1.9 by following the instructions in the help article that opens when you close this alert.")
shell.openExternal('https://theflatironschool.zendesk.com/hc/en-us/articles/235711268')

v1InitFile = path.join(atom.getConfigDirPath(), 'ide-init.coffee')
v1InitFile = path.join((atom.getConfigDirPath() || ''), 'ide-init.coffee')
if fs.existsSync(v1InitFile)
contents = fs.readFileSync(v1InitFile, 'utf8')
return if contents.indexOf(id) > -1
Expand Down

0 comments on commit 4ff60fb

Please sign in to comment.