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

Invalid option for read command in taskfile #314

Closed
GrzegorzMatuszakTSH opened this issue Apr 24, 2020 · 5 comments
Closed

Invalid option for read command in taskfile #314

GrzegorzMatuszakTSH opened this issue Apr 24, 2020 · 5 comments
Labels
dep: mvdan/sh Issues related to the upstream interpreter used by Task.

Comments

@GrzegorzMatuszakTSH
Copy link

I'm moving commands from makefile to taskfile.

I have this command in my makefile (works):

		read -p "Enter username: " username; \
		sed -i 's/{username}/'$$username'/g' ./file.json; 

When I run it using taskfile I get error read: invalid option "-p"

  test:
    desc: auth
    cmds:
      - |
          read -p "Enter username: " username; \
          sed -i 's/{username}/'$$username'/g' ./file.json; 

I tried many options without success.
Is a read available in taskfile?
I'm out of idea how to migrate this command.

@andreynering
Copy link
Member

Hi @GrzegorzMatuszakTSH, and thanks for opening this issue!

This is currently not implemented on the shell interpreter library we use. I just opened an issue there to track the progress: mvdan/sh#551.

@andreynering
Copy link
Member

For now, you should be able to use the read command without any flags.

@GrzegorzMatuszakTSH
Copy link
Author

Thank you for the explanation. As you suggested I changed the script to use read without flags and it works :)

@geek-merlin
Copy link

Also see #420, #421

@andreynering
Copy link
Member

The support for -p was implemented upstream by @parkerduckworth at mvdan/sh#722.

I'm waiting for the new release so we can update the lib here and ship for everyone, but I'll already close this issue so it isn't forgot open.

@andreynering andreynering added the dep: mvdan/sh Issues related to the upstream interpreter used by Task. label Sep 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dep: mvdan/sh Issues related to the upstream interpreter used by Task.
Projects
None yet
Development

No branches or pull requests

4 participants