-
Notifications
You must be signed in to change notification settings - Fork 168
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
Set INSTALLER_UNATTENDED
for user scripts
#885
Conversation
@mrclary - can you give this branch a try? You can check for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will be a very useful feature. I unfortunately have no idea how to do this for pkg installers either. Luckily, they are rarely installed via the command line.
Formatting aside, I only have one comment.
examples/scripts/post_install.bat
Outdated
@@ -3,6 +3,7 @@ if not "%INSTALLER_NAME%" == "Scripts" exit 1 | |||
if not "%INSTALLER_VER%" == "X" exit 1 | |||
if not "%INSTALLER_PLAT%" == "win-64" exit 1 | |||
if not "%INSTALLER_TYPE%" == "EXE" exit 1 | |||
if "%INSTALLER_UNATTENDED%" == "" exit 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the tests are run in batch/headless/silent mode, should we assert that the value be 1?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's try :)
if "%INSTALLER_UNATTENDED%" == "" exit 1 | |
if not "%INSTALLER_UNATTENDED%" == "1" exit 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's expand this to the other bat file and the sh scripts ([[ "${INSTALLER_UNATTENDED}" == "1" ]] || exit 1
or something) and I think we have a good test here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops you are right, I forgot the other files. Added some additional tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems to be passing.
Co-authored-by: Marco Esters <[email protected]>
Looks like that worked! |
Thanks @jaimergp @marcoesters 🚀 |
With conda/constructor#885, batch/silent mode installs will automatically set INSTALLER_UNATTENDED environment variable accessible by user scripts. Until the next constructor version (>3.9.3) users may set either CI=1 or INSTALLER_UNATTENDED=1 at the commandline.
With conda/constructor#885, batch/silent mode installs will automatically set INSTALLER_UNATTENDED environment variable accessible by user scripts. Until the next constructor version (>3.9.3) users may set either CI=1 or INSTALLER_UNATTENDED=1 at the commandline.
With conda/constructor#885, batch/silent mode installs will automatically set INSTALLER_UNATTENDED environment variable accessible by user scripts. Until the next constructor version (>3.9.3) users may set either CI=1 or INSTALLER_UNATTENDED=1 at the commandline.
Description
Closes #882
Checklist - did you ...
news
directory (using the template) for the next release's release notes?