Skip to content

Commit

Permalink
The bindir and scriptdir function pointed to the wrong scripts/bins. …
Browse files Browse the repository at this point in the history
…The scripts within the pkgs cannot be used because they cannot find the python interpreter.
  • Loading branch information
dhoegh committed Sep 20, 2015
1 parent 0d2042e commit 9a6553c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 29 deletions.
40 changes: 13 additions & 27 deletions src/Conda.jl
Original file line number Diff line number Diff line change
Expand Up @@ -32,37 +32,23 @@ using JSON
"Prefix for installation of all the packages."
const PREFIX = abspath(dirname(@__FILE__), "..", "deps", "usr")
"""Returns the directory for the binary files of a package. Attention on unix
`bindir` and `scriptsdir` returns the same path while on windows it is two separate directories.
Use `scriptdir()` to ex. get numpy's f2py or ipython"""
@unix_only begin function bindir(package)
packages = _installed_packages_dict()
haskey(packages, package) || error("Package '$package' not found")
joinpath(PREFIX, "pkgs", packages[package][2], "bin")
end
end
`Conda.BINDIR` and `Conda.SCRIPTDIR` returns the same path while on windows it is two separate directories.
Use `Conda.SCRIPTDIR` to ex. get the folder for numpy's f2py or ipython"""
@unix_only const BINDIR = joinpath(PREFIX, "bin")
"""Returns the directory for the scripts files of a package. Attention on unix
`bindir` and `scriptsdir` returns the same path while on windows it is two separate directories.
Use `scriptdir()` to ex. get numpy's f2py or ipython"""
scriptsdir(package) = bindir(package)
`Conda.BINDIR` and `Conda.SCRIPTDIR` returns the same path while on windows it is two separate directories.
Use `Conda.SCRIPTDIR` to ex. get the folder for numpy's f2py or ipython"""
@unix_only const SCRIPTDIR = joinpath(PREFIX, "bin")
"""Returns the directory for the binary files of a package. Attention on unix
`bindir` and `scriptsdir` returns the same path while on windows it is two separate directories.
Use `scriptdir()` to ex. get numpy's f2py or ipython"""
@windows_only function bindir(package)
packages = _installed_packages_dict()
haskey(packages, package) || error("Package '$package' not found")
joinpath(PREFIX, "pkgs", packages[package][2], "Library", "bin")
end
`Conda.BINDIR` and `Conda.SCRIPTDIR` returns the same path while on windows it is two separate directories.
Use `Conda.SCRIPTDIR` to ex. get the folder for numpy's f2py or ipython"""
@windows_only const BINDIR = joinpath(PREFIX, "Library", "bin")
"""Returns the directory for the scripts files of a package. Attention on unix
`bindir` and `scriptsdir` returns the same path while on windows it is two separate directories.
Use `scriptdir()` to ex. get numpy's f2py or ipython"""
@windows_only function scriptsdir(package)
packages = _installed_packages_dict()
haskey(packages, package) || error("Package '$package' not found")
joinpath(PREFIX, "pkgs", packages[package][2], "Scripts")
end
`Conda.BINDIR` and `Conda.SCRIPTDIR` returns the same path while on windows it is two separate directories.
Use `Conda.SCRIPTDIR` to ex. get the folder for numpy's f2py or ipython"""
@windows_only const SCRIPTDIR = joinpath(PREFIX, "Scripts")

@unix_only const conda = joinpath(PREFIX, "bin", "conda")
@windows_only const conda = joinpath(PREFIX, "Scripts", "conda")
const conda = joinpath(SCRIPTDIR, "conda")

CHANNELS = AbstractString[]
additional_channels() = ["--channel " * channel for channel in CHANNELS]
Expand Down
8 changes: 6 additions & 2 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ end

@test isfile(curl_path)

@test isfile(joinpath(Conda.bindir("curl"), basename(curl_path)))
@test isfile(joinpath(Conda.BINDIR, basename(curl_path)))

Conda.rm("curl")
@unix_only @test !isfile(curl_path)
Expand All @@ -25,4 +25,8 @@ if already_installed
Conda.add("curl")
end

@test isfile(joinpath(Conda.scriptsdir("conda"), "conda" * @windows ? ".exe": ""))
@test isfile(joinpath(Conda.SCRIPTDIR, "conda" * @windows ? ".exe": ""))

Conda.add("jupyter=4.0.0")
@test v"4.0.0"==run(`$(joinpath(Conda.SCRIPTDIR, "jypyter")) kernelspec --version`)

0 comments on commit 9a6553c

Please sign in to comment.