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 82a2aa1
Show file tree
Hide file tree
Showing 2 changed files with 18 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
7 changes: 5 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,7 @@ 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")
run(`$(joinpath(Conda.SCRIPTDIR, "jypyter")) kernelspec --version`)

0 comments on commit 82a2aa1

Please sign in to comment.