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

Commit

Permalink
add extra dirname to get correct package_name (#137)
Browse files Browse the repository at this point in the history
* add extra dirname to get correct package_name

Hopefully fix #120/

* Update based on suggestion by @staticfloat
  • Loading branch information
simonbyrne authored and staticfloat committed Nov 8, 2018
1 parent 53dbc7c commit 229e2c1
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/Products.jl
Original file line number Diff line number Diff line change
Expand Up @@ -395,8 +395,14 @@ function write_deps_file(depsjl_path::AbstractString, products::Vector{P};
escape_path = path -> replace(path, "\\" => "\\\\")

# Grab the package name as the name of the top-level directory of a package
package_name = basename(dirname(dirname(depsjl_path)))

# Auto-detect being placed within the `~/.julia/packages/XXXXX` directory
if basename(dirname(dirname(dirname(dirname(depsjl_path))))) == "packages"
package_name = basename(dirname(dirname(dirname(depsjl_path))))
else
# otherwise assume same as folder name
# TODO: check Project.toml
package_name = basename(dirname(dirname(depsjl_path)))
end
# We say this a couple of times
rebuild = strip("""
Please re-run Pkg.build(\\\"$(package_name)\\\"), and restart Julia.
Expand Down

0 comments on commit 229e2c1

Please sign in to comment.