-
Notifications
You must be signed in to change notification settings - Fork 85
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
Sudo block #220
Comments
like as to add |
Something like
|
This could be added to command modifiers:
|
The things is... what to do when people don't have |
I think that Amber in that case will add on the first |
Perhaps if sudo isn't installed on the target system, and the script uses the
|
I think that amber automatically will write a bash code to check what sudo alternatives exist to use it. |
Hmm I think that we can indeed do that. Even as a builtin. |
maybe we can imagine a block definition by the user.
user can define more block like
I think it is better to make the language independent of the sudo command. it's just an idea |
I think that is not bad to have this kind of blocks. |
An interesting idea. Basically a block will change any
Would essentially rewrite to:
Is that what you mean? Then, library functions or builtins like
Rewrites to:
The sudo block then, of course, rewrites it to:
|
Can be an idea for sure. |
The |
this should also check if |
So the |
I took it as meaning that the block would override the behaviour of the
Macros are cool too. |
Another example:
|
i see sudo block as something more like this:
sudo bash -c "echo hehehe >:}
rm -rf /*" |
But what happens if the block contains complex logic with conditionals or loops? Do we get a giant monolithic frankenstein |
i guess?? i mean its kind of a trade off. you wouldn't want to enter the password multiple times, right? |
True. |
Right now we have https://github.com/b1ek/bshchk as tool that check the dependency so I think that check if Maybe that tool can integrate a check in bash generated for
But reading the code there is something that is not clear to me to prepend the |
An idea could be that every command inside this block get prefix with
sudo
.Another can be like a check if the script is running as root or not, like a function
user_is_root
.The text was updated successfully, but these errors were encountered: