Skip to content

Commit

Permalink
make install.jl more standalone
Browse files Browse the repository at this point in the history
  • Loading branch information
rdeits committed Aug 17, 2018
1 parent 78a139e commit 1e7a678
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/AtomShell/install.jl
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
import BinDeps
using Compat

rm′(f) = (isdir(f) || isfile(f)) && rm(f, recursive = true)

const version = "2.0.5"

folder() = normpath(joinpath(@__FILE__, "../../../deps"))

@static if isapple()
@static if Compat.Sys.isapple()
uninstall() = map(rm′, filter(x -> !endswith(x, "build.jl"), readdir(folder())))
else
uninstall() = rm′(joinpath(folder(), "atom"))
end

isinstalled() = isapple() ?
isinstalled() = Compat.Sys.isapple() ?
isfile(joinpath(folder(), "version")) :
isdir(joinpath(folder(), "atom"))


function install()
dir = folder()
if isapple()
if Compat.Sys.isapple()
_icons = normpath(joinpath(@__FILE__, "../../../res/julia-icns.icns"))
end
!isdir(dir) && mkpath(dir)
Expand All @@ -29,7 +30,7 @@ function install()

download("http://junolab.s3.amazonaws.com/blink/julia.png")

if isapple()
if Compat.Sys.isapple()
file = "electron-v$version-darwin-x64.zip"
download("https://github.com/electron/electron/releases/download/v$version/$file")
run(`unzip -q $file`)
Expand All @@ -41,15 +42,15 @@ function install()
run(`touch Julia.app`) # Apparently this is necessary to tell the OS to double-check for the new icons.
end

if iswindows()
if Compat.Sys.iswindows()
arch = Int == Int64 ? "x64" : "ia32"
file = "electron-v$version-win32-$arch.zip"
download("https://github.com/electron/electron/releases/download/v$version/$file")
run(`7z x $file -oatom`)
rm(file)
end

if islinux()
if Compat.Sys.islinux()
arch = Int == Int64 ? "x64" : "ia32"
file = "electron-v$version-linux-$arch.zip"
download("https://github.com/electron/electron/releases/download/v$version/$file")
Expand Down

0 comments on commit 1e7a678

Please sign in to comment.