Skip to content
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

Fix problems related to dockersand.bat #194

Merged
merged 3 commits into from
Jul 10, 2024
Merged

Conversation

Hoikas
Copy link
Member

@Hoikas Hoikas commented Jul 9, 2024

Got a report on discord:

PS D:\dirtsand> ./dockersand build
./dockersand : File D:\dirtsand\dockersand.ps1 cannot be loaded because running scripts is disabled on this system.
For more information, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1
+ ./dockersand build
+ ~~~~
    + CategoryInfo          : SecurityError: (:) [], PSSecurityException
    + FullyQualifiedErrorId : UnauthorizedAccess

Assuming that ./dockersand is mapping to dockersand.bat, the default policy might be messing with us. Most all resources online suggest using NoProfile when using helper scripts to launch PowerShell, so let's do it.

@dpogue
Copy link
Member

dpogue commented Jul 9, 2024

If you are running in a PowerShell prompt then I'm pretty sure ./dockersand is the .ps1 file.

@Hoikas
Copy link
Member Author

Hoikas commented Jul 9, 2024

If you are running in a PowerShell prompt then I'm pretty sure ./dockersand is the .ps1 file.

Confirmed

PS D:\Plasma\dirtsand> ./dockersand help
dockersand - DIRTSAND for Docker
Available commands:
    attach - attach to the DIRTSAND console
    build - rebuild the DIRTSAND containers from the source and compose files
    restart - restart the DIRTSAND containers
    start - start the DIRTSAND containers
    status - check if the DIRTSAND containers are running
    stop - stop the DIRTSAND containers
PS D:\Plasma\dirtsand> Remove-Item dockersand.bat
PS D:\Plasma\dirtsand> ./dockersand help
dockersand - DIRTSAND for Docker
Available commands:
    attach - attach to the DIRTSAND console
    build - rebuild the DIRTSAND containers from the source and compose files
    restart - restart the DIRTSAND containers
    start - start the DIRTSAND containers
    status - check if the DIRTSAND containers are running
    stop - stop the DIRTSAND containers
PS D:\Plasma\dirtsand> git status
On branch pwsh_noprofile
Changes not staged for commit:
  (use "git add/rm <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        deleted:    dockersand.bat

Upon manually executing dockersand.bat, I found that it didn't even work. I've pushed a fix for that, and I'll push some changes to the README to point toward the command prompt offer real suggestions for execution policy exceptions in PS prompts.

@Hoikas Hoikas changed the title Use -NoProfile for the powershell dockersand. Fix problems related to dockersand.bat Jul 9, 2024
@Hoikas Hoikas marked this pull request as draft July 9, 2024 23:27
@Hoikas Hoikas marked this pull request as ready for review July 9, 2024 23:35
@zrax zrax merged commit c92125e into H-uru:master Jul 10, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants