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

Syntax error for a valid script #204

Open
certik opened this issue Jan 22, 2025 · 1 comment
Open

Syntax error for a valid script #204

certik opened this issue Jan 22, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@certik
Copy link
Collaborator

certik commented Jan 22, 2025

The following script:

#! /bin/sh

if test -n "${xml_catalog_files_libxml2:-}"; then
    export XML_CATALOG_FILES="${xml_catalog_files_libxml2}"
else
    unset XML_CATALOG_FILES
fi
unset xml_catalog_files_libxml2

Gives:

$ source "/Users/ondrej/miniforge3/envs/spawn2/etc/conda/deactivate.d/libxml2_deactivate.sh"
Syntax error:   × Failed to parse input
  ╰─▶ Failure to parse at Pos((3, 43))
   ╭────
 1 │ if test -n "${xml_catalog_files_libxml2:-}"; then
   ·                                           ┬
   ·                                           ╰── expected QUOTED_ESCAPE_CHAR, QUOTED_CHAR, VARIABLE_EXPANSION, SUB_COMMAND, or EXIT_STATUS
   ╰────
  help: expected QUOTED_ESCAPE_CHAR, QUOTED_CHAR, VARIABLE_EXPANSION,
        SUB_COMMAND, or EXIT_STATUS
@certik
Copy link
Collaborator Author

certik commented Jan 22, 2025

The following workaround parses:

#! /bin/sh

if [ -n "${xml_catalog_files_libxml2:-}" ]; then
    export XML_CATALOG_FILES="${xml_catalog_files_libxml2}"
else
    unset XML_CATALOG_FILES
fi
unset xml_catalog_files_libxml2

but panics:

$ RUST_BACKTRACE=1 shell /Users/ondrej/miniforge3/envs/spawn2/etc/conda/deactivate.d/libxml2_deactivate.sh
thread 'main' panicked at crates/deno_task_shell/src/shell/execute.rs:1045:42:
not yet implemented
stack backtrace:
   0: _rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::panicking::panic
   3: deno_task_shell::shell::execute::execute_command::{{closure}}
   4: deno_task_shell::shell::execute::execute_sequence::{{closure}}
   5: deno_task_shell::shell::execute::execute_sequential_list::{{closure}}
   6: shell::execute::execute::{{closure}}
   7: tokio::runtime::park::CachedParkThread::block_on
   8: shell::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant