-
Notifications
You must be signed in to change notification settings - Fork 28
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
Handling platform specific delimiters #3
Comments
I think using ie.
|
Good point, I haven't used |
So, I love the idea of this, but I'm not sold on the
At first glance it makes me think (although I know it's not true) that I'd like to briefly consider another delimiter. Any other suggestions? How about @DanReyLop or @kentcdodds |
Honestly, it seems to me like that would belong to a separate package as well.. I realize that this can get a little rediculous:
But I really believe in the linux philosophy of doing one thing well. And I believe that once such a package exists, you could create a final package that ties them all together quite nicely:
|
How about
Yes please, that! I use Ideally I would want to write this: No PS: Congrats @kentcdodds on your 1000 stars on |
@DanReyLop, have you considered using nps? You could make a function that could handle this for you and really clean up your scripts (and perhaps such a function could be included in nps-utils :) |
I just realized that |
Nice, I didn't know that! Should we consider Looking at the code (haven't tried it yet),
Didn't know about |
True, but people get used to it 🤷♂️
If you install
I think that But to each their own! As to supporting this specific issue in |
Exactly. I'm not saying That's why this is not urgent for me, for now it's just a little experiment branch.
I'll create an issue later today, we'll surely figure something out, this feature is very useful. |
Well, I didn't realize The one thing
Which is why I created the alternate syntax of having the first argument being a string that will be executed once all the replacements have been made. I wonder if that could be a feature of |
Me either! 😅 my bad! You're right, |
@kentcdodds I would be cool to deprecate |
One benefit I find with For instance, with: "name": "my-nice-app",
scripts: {
"cross_env": "cross-env echo $npm_package_name",
"cross_var": "cross-var echo $npm_package_name"
} This results in the following on Windows (with Windows cmd, CygWin bash or VSCode bash): $ npm run cross_env
%npm_package_name%
$ npm run cross_var
my-nice-app where I would expect to see |
That sounds more like a |
@kentcdodds , Ok, based on the description of |
closing this issue since it's going to be addressed in |
To close the loop, as discussed at kentcdodds/cross-env#91, using environment variables defined "outside of" this command (e.g. for environment variables defined by npm such as |
This isn't necessarily an issue, but it'd be nice to handle platform specific delimiters for environment variables that contain a list of entries.
$PATH
and$NODE_PATH
are examples of entry lists. NODE_PATH documentation.On Windows the delimiter is
;
(semicolon) and is:
(colon) on most other platforms.Would there be a clean way to replace
:
with;
on Windows without disrupting users that actually want to insert:
on Windows?The text was updated successfully, but these errors were encountered: