Skip to content

Commit

Permalink
Use .slice() instead of .pop()
Browse files Browse the repository at this point in the history
  • Loading branch information
rustdevbtw committed May 15, 2024
1 parent b39b3c3 commit d3f2779
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/modes/install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,8 @@ export default async function(pkgs: PackageRequirement[], unsafe: boolean) {

if (UNSAFE) {
const config = hooks.useConfig()
const parts = pkgstr.split("/")
parts.pop()
config.cache.join(`pkgx/envs/${parts.join("/")}`).mkdir("p")
const pkgdir = pkgstr.split("/").slice(0, -1).join("/")
config.cache.join(`pkgx/envs/${pkgdir}`).mkdir("p")
//FIXME: doing `set -a` clears the args env
script = undent`
if [ "$PKGX_UNINSTALL" != 1 ]; then
Expand Down

0 comments on commit d3f2779

Please sign in to comment.