-
-
Notifications
You must be signed in to change notification settings - Fork 640
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
$GID not found #561
Comments
I was not able to reproduce:
what shell are you using?
|
Same results with bash. Full output:
|
I see. You are using zsh:
IIUIC: zsh does set GID internaly. Therefore it is an Issue related to mvdan.cc/sh. |
As a workaround, you could use |
after patching mvdan.cc/sh, i was able to access diff --git a/interp/api.go b/interp/api.go
index 6ac3dc34..b7526c56 100644
--- a/interp/api.go
+++ b/interp/api.go
@@ -444,6 +444,13 @@ func (r *Runner) Reset() {
Str: strconv.Itoa(os.Getuid()),
})
}
+ if !r.writeEnv.Get("GID").IsSet() {
+ r.setVar("GID", nil, expand.Variable{
+ Kind: expand.String,
+ ReadOnly: true,
+ Str: strconv.Itoa(os.Getgid()),
+ })
+ }
r.setVarString("PWD", r.Dir)
r.setVarString("IFS", " \t\n")
r.setVarString("OPTIND", "1") Output:
|
What about cross-platform feature in Taskfile? :) If you think that the idea is bad (or does not fit Taskfile ideas) I think you can close this issue: the problem is not yours. Anyway, thanks for your research. |
Hmm I'm new here but my guess it relates only to
Lets see what the maintainer of
np. :) was an opportunity to learn something new. |
I think it can fix only mvdan/sh, not zsh, bash, sh, fish and so on...
пн, 6 сент. 2021 г., 18:49 Marcello Sylvester Bauer <
***@***.***>:
… What about cross-platform feature in Taskfile? :)
If it is exist looks like Taskfile should provide some API (or yeap,
several global variables) like UID, GID.
Hmm I'm new here but my guess is, is relates only to mvdan/sh and would
be overkill in task.
If you think that the idea is bad (or does not fit Taskfile ideas) I think
you can close this issue: the problem is not yours.
Lets see what the maintainer of mvdan/sh think about it. I created an PR
<mvdan/sh#723> which would fix you issue. But
maybe there is a reason not to add GID internally. (e.g. maybe not POSIX
Shell compliant)
Anyway, thanks for your research.
np. :) was an opportunity to learn something new.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#561 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABRBAYD6TQI4WKZHLYZGNGLUATPIXANCNFSM5C5OAJMA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
sure, the scope of this issue is |
So and what about other shells? :(
пн, 6 сент. 2021 г., 22:46 Marcello Sylvester Bauer <
***@***.***>:
… I think it can fix only mvdan/sh, not zsh, bash, sh, fish and so on... пн,
6 сент. 2021 г., 18:49 Marcello Sylvester Bauer < *@*.***>:
… <#m_-3325311544333467101_>
What about cross-platform feature in Taskfile? :) If it is exist looks
like Taskfile should provide some API (or yeap, several global variables)
like UID, GID. Hmm I'm new here but my guess is, is relates only to
mvdan/sh and would be overkill in task. If you think that the idea is bad
(or does not fit Taskfile ideas) I think you can close this issue: the
problem is not yours. Lets see what the maintainer of mvdan/sh think about
it. I created an PR <mvdan/sh#723 <mvdan/sh#723>>
which would fix you issue. But maybe there is a reason not to add GID
internally. (e.g. maybe not POSIX Shell compliant) Anyway, thanks for your
research. np. :) was an opportunity to learn something new. — You are
receiving this because you authored the thread. Reply to this email
directly, view it on GitHub <#561 (comment)
<#561 (comment)>>, or
unsubscribe
https://github.com/notifications/unsubscribe-auth/ABRBAYD6TQI4WKZHLYZGNGLUATPIXANCNFSM5C5OAJMA
. Triage notifications on the go with GitHub Mobile for iOS
https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675
or Android
https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub
.
sure, the scope of this issue is task which only uses mvdan/sh.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#561 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABRBAYEEKGPYIYKFV4HCMCDUAULCBANCNFSM5C5OAJMA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
hmm i guess there is a miss understanding. If you want to add GID internally into other shells, you can give it a try (e.g. in bash). |
ok, the issue is not from Taskfile scope and it's a problem of specific shell, ok. but I do not understand why are we speaking about mbdan/sh here :D |
Because the issue topic is |
ok, thanks
вт, 7 сент. 2021 г. в 23:02, Marcello Sylvester Bauer <
***@***.***>:
… ok, the issue is not from Taskfile scope and it's a problem of specific
shell, ok. but I do not understand why are we speaking about mbdan/sh here
:D
Because the issue topic is $GID not found and task only uses mbdan/sh.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#561 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABRBAYAQK3YZEBPTILCMTU3UAZVULANCNFSM5C5OAJMA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
mvdan/sh#723 got merged, but we should wait for the next module release ( |
Task version: v3.7.0 (h1:8dDFv12/Lxi6PHkYNIIm7N6v6oRGxePpLK67LuMh/Rs=)
Operating System: Linux 5.13.10-arch1-1 Would love a feature to re run a task on file change #1 SMP PREEMPT Thu, 12 Aug 2021 21:59:14 +0000 x86_64 GNU/Linux
Example Taskfile showing the issue
check it:
The text was updated successfully, but these errors were encountered: