Skip to content

Commit

Permalink
Fix dev off when environment is not active
Browse files Browse the repository at this point in the history
And also make sure to pass rm -f as some people alias rm to rm -i.
  • Loading branch information
felipecrs committed Feb 22, 2024
1 parent 104affb commit bc569f8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/modes/internal.activate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export default async function(dir: Path, { powder, ...opts }: { powder: PackageR
env ${off_string}
if [ "$1" != --shy ]; then
rm "${persistence}"
rm -f "${persistence}"
fi
unset -f _pkgx_dev_off _pkgx_should_deactivate_devenv
Expand Down
9 changes: 7 additions & 2 deletions src/modes/shellcode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export default function() {
${sh} "${tmp}/shellcode/x.$$"
unset foo
fi
rm "${tmp}/shellcode/"?.$$
rm -f "${tmp}/shellcode/"?.$$
else
echo "pkgx: nothing to run" >&2
return 1
Expand Down Expand Up @@ -90,7 +90,12 @@ export default function() {
dev() {
if [ "$1" = 'off' ]; then
_pkgx_dev_off
if type _pkgx_dev_off >/dev/null 2>&1; then
_pkgx_dev_off
else
echo 'dev: environment not active' >&2
return 1
fi
elif type _pkgx_dev_off >/dev/null 2>&1; then
echo 'dev: environment already active' >&2
return 1
Expand Down

0 comments on commit bc569f8

Please sign in to comment.