Open Mte90 opened 3 days ago
a few years ago, I used a preprocessor written in PHP for my bash script. It was used to replace keywords with code snippets. i think a similar system can be used especially for this
for example : #[execute_in_temp_folder]
replaced by unsafe $mktemp -d$
in my preprocessor the use was mainly for dependencies, this could solve dependency checker
for example : #[depends:dialog/dialog]
replaced by unsafe $if ! [ -x "\$(command -v dialog)" ];then echo \$"dialog command could not be found, install package dialog";exit 1; fi;$
and many other..
all my snippets were stored in a file, one file by snippet
Yes can be an attribute, for the dependency there is another ticket https://github.com/Ph0enixKM/Amber/issues/95
what is exactly the point of this feature though?
Usually scripts run in a folder dedicated so they don't mess with the system. Like file editing and so on, the idea is to have like a sandbox generated automatically and the cwd/pwd.
It is the same stuff for https://github.com/Ph0enixKM/Amber/issues/219 or https://github.com/Ph0enixKM/Amber/issues/223
The idea is to have a flag that you put on top of the Amber script that automatically with
mktemp -d
create a temporary folder and move the PWD/CWD to that.