Skip to content
This repository has been archived by the owner on Jan 6, 2021. It is now read-only.

cross-env-shell doesn't like relative paths #127

Closed
derekgreer opened this issue Jul 26, 2017 · 4 comments
Closed

cross-env-shell doesn't like relative paths #127

derekgreer opened this issue Jul 26, 2017 · 4 comments

Comments

@derekgreer
Copy link

I've got a script as follows:

 "deploy:api": "cross-env-shell ./scripts/install.bat Services.Api ApiService $ENVIRONMENT",

I run this as so:

$> ENVIRONMENT=integration yarn run deploy:api

This results in the following error:

'.' is not recognized as an internal or external command,
operable program or batch file.
events.js:160
      throw er; // Unhandled 'error' event
      ^

yarn will run the relative script without cross-env-shell, but of course then you don't get the environment variable substitution

@kentcdodds
Copy link
Owner

Try:

 "deploy:api": "cross-env-shell \"./scripts/install.bat Services.Api ApiService $ENVIRONMENT\"",

@derekgreer
Copy link
Author

I tried that, but got the same results.

@kentcdodds
Copy link
Owner

Seems like a bug. Happy to accept a PR to fix it.

@sudo-suhas
Copy link
Contributor

Should this be taken care in commandConvert? parseCommand correctly identifies the command but spawn chokes on ./.

kentcdodds pushed a commit that referenced this issue Aug 1, 2017
* fix: Normalize command to handle relative path on windows

* test: Normalize command for embedded env variable conversion test

* docs(contributors): Add @sudo-suhas

Closes #127
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants