Skip to content

Commit

Permalink
win: improve script environment robustness #221
Browse files Browse the repository at this point in the history
This commit ensures the script functions as expected, even when invoked
from unexpected environments.

Using `setlocal` initializes a distinct environment for privacy.sexy.
It's strategically placed after the admin privilege check to avoid
unnecessary setup in case of a relaunch. The script concludes with
`endlocal` right before the exit, maintaining a clean environment
throughout its execution and ensuring no unintentional global
environment modifications.

Changes:

- Enhance script's environment robustness.
- Add descriptive comments for script start/end sequences.
  • Loading branch information
undergroundwires committed Oct 24, 2023
1 parent 8570b02 commit dfd4451
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/application/collections/windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,14 @@ scripting:
)
exit 0
)
:: Initialize environment
setlocal EnableExtensions DisableDelayedExpansion
endCode: |-
:: Pause the script to view the final state
pause
:: Restore previous environment settings
endlocal
:: Exit the script successfully
exit /b 0
actions:
-
Expand Down

0 comments on commit dfd4451

Please sign in to comment.