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

Installation on Zsh #3

Closed
aloysb opened this issue Oct 26, 2022 · 9 comments
Closed

Installation on Zsh #3

aloysb opened this issue Oct 26, 2022 · 9 comments

Comments

@aloysb
Copy link

aloysb commented Oct 26, 2022

The installation does seem to work on a zsh.

Steps to reproduce:

  • Open a terminal with zsh
  • Install zx
  • Run the install script: zx https://raw.githubusercontent.com/pyronaur/zxb/main/src/inc/install.mjs
  • Reload the terminal

The installation seems to fail.

❯ zxb  
zsh: command not found: zxb
@aloysb
Copy link
Author

aloysb commented Oct 26, 2022

The issue seems to be coming from here:

if (process.args?._?.length === 1 && !process.args._[0].includes('zxb.mjs')) { on the install scripts.

I am unsure what this guard is doing , but by commenting it out I successfully installed zxb.

I'd be happy to put a PR for this, but maybe someone has a better insight in that guard condition?

@pyronaur
Copy link
Owner

Hey! Thanks for letting me know.
I haven't checked what's going on there yet. zx seems to have switched how argv is handled a couple of times during the past few versions.

@aloysb
Copy link
Author

aloysb commented Oct 26, 2022 via email

@pyronaur
Copy link
Owner

Thanks!

Fixed the install issue: a58ca0f

What OS are you running? zxb lse works on my mac, but doesn't work on Ubuntu, so I think something might be up there.

@aloysb
Copy link
Author

aloysb commented Oct 26, 2022 via email

@pyronaur
Copy link
Owner

Oh, Ubuntu isn't to blame, after all, reproduced on mac as well. Looking...

@aloysb
Copy link
Author

aloysb commented Oct 26, 2022

It seems to be around line 63 on the main file.

I'm just on my phone right now so hard to debug, you have a condition:

if(input && !action)

Probably another issue with the indexing of argv?

@aloysb
Copy link
Author

aloysb commented Oct 26, 2022

Yes I can't test but I'd say input returns undefined because of the argv indexing.. it's looking at index 1, not 0.

But again, from my mobile so this is untested!

@pyronaur
Copy link
Owner

pyronaur commented Oct 26, 2022

Yeah, the indexes were off because zx changed that in v7, and I got confused along the way with my messy dev environment (I've got the git project symlinked and after testing updates forgot to re-link)

I've updated zxb to v1.0.5 now. zxb update should do the trick, if it doesn't, just run the install script again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants