Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix dev off when environment is not active #979

Merged
merged 1 commit into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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