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

[whitespace] sourcing init hooks: wrap project dir path in quotes #2393

Merged
merged 1 commit into from
Oct 29, 2024

Conversation

savil
Copy link
Collaborator

@savil savil commented Oct 29, 2024

Summary

Fixes #2374

Should also audit other sites...

How was it tested?

Should add an automated test but trying to squeeze this out.

in /Users/savil/code/jetpack/devbox-projects/project with spaces:

% cat devbox.json
{
  "packages": [],
  "shell": {
    "init_hook": [
      "echo 'Welcome to devbox!' > /dev/null"
    ],
    "scripts": {
      "test": [
        "echo \"Error: no test specified\" && exit 1"
      ]
    }
  }
}

did devbox generate direnv

BEFORE: when cd-ing:

Success: generated .envrc file
Success: ran `direnv allow`
direnv: loading ~/code/jetpack/devbox-projects/project with spaces/.envrc
direnv: using devbox
/bin/bash:131: /Users/savil/code/jetpack/devbox-projects/project: No such file or directory
direnv: export +AR +AS +CC +CONFIG_SHELL +CXX +DEVBOX_NIX_ENV_PATH_b34d1ddb08645bdcc5635ad815352419d9e4c170665ecc20e5abdb7503e1fe80 +HOST_PATH +IN_NIX_SHELL +LD +LD_DYLD_PATH +MACOSX_DEPLOYMENT_TARGET +NIX_BINTOOLS +NIX_BINTOOLS_WRAPPER_TARGET_HOST_x86_64_apple_darwin +NIX_BUILD_CORES +NIX_CC +NIX_CC_WRAPPER_TARGET_HOST_x86_64_apple_darwin +NIX_CFLAGS_COMPILE +NIX_COREFOUNDATION_RPATH +NIX_DONT_SET_RPATH +NIX_DONT_SET_RPATH_FOR_BUILD +NIX_ENFORCE_NO_NATIVE +NIX_HARDENING_ENABLE +NIX_IGNORE_LD_THROUGH_GCC +NIX_LDFLAGS +NIX_NO_SELF_RPATH +NIX_STORE +NM +PATH_LOCALE +RANLIB +SIZE +SOURCE_DATE_EPOCH +STRINGS +STRIP +__DEVBOX_SHELLENV_HASH_b34d1ddb08645bdcc5635ad815352419d9e4c170665ecc20e5abdb7503e1fe80 +__darwinAllowLocalNetworking +__impureHostDeps +__propagatedImpureHostDeps +__propagatedSandboxProfile +__sandboxProfile +__structuredAttrs +buildInputs +buildPhase +builder +cmakeFlags +configureFlags +depsBuildBuild +depsBuildBuildPropagated +depsBuildTarget +depsBuildTargetPropagated +depsHostHost +depsHostHostPropagated +depsTargetTarget +depsTargetTargetPropagated +doCheck +doInstallCheck +dontAddDisableDepTrack +mesonFlags +name +nativeBuildInputs +out +outputs +patches +phases +preferLocalBuild +propagatedBuildInputs +propagatedNativeBuildInputs +shell +shellHook +stdenv +strictDeps +system ~DEVBOX_CONFIG_DIR ~DEVBOX_PACKAGES_DIR ~DEVBOX_PATH_STACK ~DEVBOX_PROJECT_ROOT ~DEVBOX_WD ~PATH

AFTER:

% cd 'project with spaces'
direnv: loading ~/code/jetpack/devbox-projects/project with spaces/.envrc
direnv: using devbox
direnv: export +AR +AS +CC +CONFIG_SHELL +CXX +DEVBOX_NIX_ENV_PATH_b34d1ddb08645bdcc5635ad815352419d9e4c170665ecc20e5abdb7503e1fe80 +HOST_PATH +IN_NIX_SHELL +LD +LD_DYLD_PATH +MACOSX_DEPLOYMENT_TARGET +NIX_BINTOOLS +NIX_BINTOOLS_WRAPPER_TARGET_HOST_x86_64_apple_darwin +NIX_BUILD_CORES +NIX_CC +NIX_CC_WRAPPER_TARGET_HOST_x86_64_apple_darwin +NIX_CFLAGS_COMPILE +NIX_COREFOUNDATION_RPATH +NIX_DONT_SET_RPATH +NIX_DONT_SET_RPATH_FOR_BUILD +NIX_ENFORCE_NO_NATIVE +NIX_HARDENING_ENABLE +NIX_IGNORE_LD_THROUGH_GCC +NIX_LDFLAGS +NIX_NO_SELF_RPATH +NIX_STORE +NM +PATH_LOCALE +RANLIB +SIZE +SOURCE_DATE_EPOCH +STRINGS +STRIP +__DEVBOX_SHELLENV_HASH_b34d1ddb08645bdcc5635ad815352419d9e4c170665ecc20e5abdb7503e1fe80 +__darwinAllowLocalNetworking +__impureHostDeps +__propagatedImpureHostDeps +__propagatedSandboxProfile +__sandboxProfile +__structuredAttrs +buildInputs +buildPhase +builder +cmakeFlags +configureFlags +depsBuildBuild +depsBuildBuildPropagated +depsBuildTarget +depsBuildTargetPropagated +depsHostHost +depsHostHostPropagated +depsTargetTarget +depsTargetTargetPropagated +doCheck +doInstallCheck +dontAddDisableDepTrack +mesonFlags +name +nativeBuildInputs +out +outputs +patches +phases +preferLocalBuild +propagatedBuildInputs +propagatedNativeBuildInputs +shell +shellHook +stdenv +strictDeps +system ~DEVBOX_CONFIG_DIR ~DEVBOX_PACKAGES_DIR ~DEVBOX_PATH_STACK ~DEVBOX_PROJECT_ROOT ~DEVBOX_WD ~PATH

@savil savil merged commit 0bc66cb into main Oct 29, 2024
29 checks passed
@savil savil deleted the savil/whitespace-path branch October 29, 2024 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Whitespace in project directory breaks devbox shellenv ...
2 participants