Skip to content

Commit

Permalink
feat: move ps1 NoModifyPath to env
Browse files Browse the repository at this point in the history
  • Loading branch information
mistydemeo committed Sep 16, 2024
1 parent 20f4c94 commit b2cf35c
Show file tree
Hide file tree
Showing 37 changed files with 228 additions and 190 deletions.
11 changes: 6 additions & 5 deletions cargo-dist/templates/installer/installer.ps1.j2
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ It will then add that dir to PATH by editing your Environment.Path registry key
.PARAMETER ArtifactDownloadUrl
The URL of the directory where artifacts can be fetched from

.PARAMETER NoModifyPath
Don't add the install directory to PATH

.PARAMETER Help
Print help

Expand All @@ -41,8 +38,6 @@ Print help
param (
[Parameter(HelpMessage = "The URL of the directory where artifacts can be fetched from")]
[string]$ArtifactDownloadUrl = '{{ base_url }}',
[Parameter(HelpMessage = "Don't add the install directory to PATH")]
[switch]$NoModifyPath,
[Parameter(HelpMessage = "Print Help")]
[switch]$Help
)
Expand All @@ -61,7 +56,13 @@ if ($env:{{ disable_update_env_var }}) {
$install_updater = $true
}

$NoModifyPath = $false
if ($env:{{ no_modify_path_env_var }}) {
$NoModifyPath = $true
}

$unmanaged_install = $env:{{ unmanaged_dir_env_var }}

if ($unmanaged_install) {
$NoModifyPath = $true
$install_updater = $false
Expand Down
11 changes: 6 additions & 5 deletions cargo-dist/tests/snapshots/akaikatana_basic.snap
Original file line number Diff line number Diff line change
Expand Up @@ -1274,9 +1274,6 @@ It will then add that dir to PATH by editing your Environment.Path registry key
.PARAMETER ArtifactDownloadUrl
The URL of the directory where artifacts can be fetched from

.PARAMETER NoModifyPath
Don't add the install directory to PATH

.PARAMETER Help
Print help

Expand All @@ -1285,8 +1282,6 @@ Print help
param (
[Parameter(HelpMessage = "The URL of the directory where artifacts can be fetched from")]
[string]$ArtifactDownloadUrl = 'https://github.com/mistydemeo/akaikatana-repack/releases/download/v0.2.0',
[Parameter(HelpMessage = "Don't add the install directory to PATH")]
[switch]$NoModifyPath,
[Parameter(HelpMessage = "Print Help")]
[switch]$Help
)
Expand All @@ -1305,7 +1300,13 @@ if ($env:AKAIKATANA_REPACK_DISABLE_UPDATE) {
$install_updater = $true
}

$NoModifyPath = $false
if ($env:AKAIKATANA_REPACK_NO_MODIFY_PATH) {
$NoModifyPath = $true
}

$unmanaged_install = $env:AKAIKATANA_REPACK_UNMANAGED_INSTALL

if ($unmanaged_install) {
$NoModifyPath = $true
$install_updater = $false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1302,9 +1302,6 @@ It will then add that dir to PATH by editing your Environment.Path registry key
.PARAMETER ArtifactDownloadUrl
The URL of the directory where artifacts can be fetched from

.PARAMETER NoModifyPath
Don't add the install directory to PATH

.PARAMETER Help
Print help

Expand All @@ -1313,8 +1310,6 @@ Print help
param (
[Parameter(HelpMessage = "The URL of the directory where artifacts can be fetched from")]
[string]$ArtifactDownloadUrl = 'https://github.com/mistydemeo/akaikatana-repack/releases/download/v0.2.0',
[Parameter(HelpMessage = "Don't add the install directory to PATH")]
[switch]$NoModifyPath,
[Parameter(HelpMessage = "Print Help")]
[switch]$Help
)
Expand All @@ -1333,7 +1328,13 @@ if ($env:AKAIKATANA_REPACK_DISABLE_UPDATE) {
$install_updater = $true
}

$NoModifyPath = $false
if ($env:AKAIKATANA_REPACK_NO_MODIFY_PATH) {
$NoModifyPath = $true
}

$unmanaged_install = $env:AKAIKATANA_REPACK_UNMANAGED_INSTALL

if ($unmanaged_install) {
$NoModifyPath = $true
$install_updater = $false
Expand Down
11 changes: 6 additions & 5 deletions cargo-dist/tests/snapshots/akaikatana_two_bin_aliases.snap
Original file line number Diff line number Diff line change
Expand Up @@ -1326,9 +1326,6 @@ It will then add that dir to PATH by editing your Environment.Path registry key
.PARAMETER ArtifactDownloadUrl
The URL of the directory where artifacts can be fetched from

.PARAMETER NoModifyPath
Don't add the install directory to PATH

.PARAMETER Help
Print help

Expand All @@ -1337,8 +1334,6 @@ Print help
param (
[Parameter(HelpMessage = "The URL of the directory where artifacts can be fetched from")]
[string]$ArtifactDownloadUrl = 'https://github.com/mistydemeo/akaikatana-repack/releases/download/v0.2.0',
[Parameter(HelpMessage = "Don't add the install directory to PATH")]
[switch]$NoModifyPath,
[Parameter(HelpMessage = "Print Help")]
[switch]$Help
)
Expand All @@ -1357,7 +1352,13 @@ if ($env:AKAIKATANA_REPACK_DISABLE_UPDATE) {
$install_updater = $true
}

$NoModifyPath = $false
if ($env:AKAIKATANA_REPACK_NO_MODIFY_PATH) {
$NoModifyPath = $true
}

$unmanaged_install = $env:AKAIKATANA_REPACK_UNMANAGED_INSTALL

if ($unmanaged_install) {
$NoModifyPath = $true
$install_updater = $false
Expand Down
11 changes: 6 additions & 5 deletions cargo-dist/tests/snapshots/akaikatana_updaters.snap
Original file line number Diff line number Diff line change
Expand Up @@ -1274,9 +1274,6 @@ It will then add that dir to PATH by editing your Environment.Path registry key
.PARAMETER ArtifactDownloadUrl
The URL of the directory where artifacts can be fetched from

.PARAMETER NoModifyPath
Don't add the install directory to PATH

.PARAMETER Help
Print help

Expand All @@ -1285,8 +1282,6 @@ Print help
param (
[Parameter(HelpMessage = "The URL of the directory where artifacts can be fetched from")]
[string]$ArtifactDownloadUrl = 'https://github.com/mistydemeo/akaikatana-repack/releases/download/v0.2.0',
[Parameter(HelpMessage = "Don't add the install directory to PATH")]
[switch]$NoModifyPath,
[Parameter(HelpMessage = "Print Help")]
[switch]$Help
)
Expand All @@ -1305,7 +1300,13 @@ if ($env:AKAIKATANA_REPACK_DISABLE_UPDATE) {
$install_updater = $true
}

$NoModifyPath = $false
if ($env:AKAIKATANA_REPACK_NO_MODIFY_PATH) {
$NoModifyPath = $true
}

$unmanaged_install = $env:AKAIKATANA_REPACK_UNMANAGED_INSTALL

if ($unmanaged_install) {
$NoModifyPath = $true
$install_updater = $false
Expand Down
11 changes: 6 additions & 5 deletions cargo-dist/tests/snapshots/axolotlsay_abyss.snap
Original file line number Diff line number Diff line change
Expand Up @@ -1274,9 +1274,6 @@ It will then add that dir to PATH by editing your Environment.Path registry key
.PARAMETER ArtifactDownloadUrl
The URL of the directory where artifacts can be fetched from

.PARAMETER NoModifyPath
Don't add the install directory to PATH

.PARAMETER Help
Print help

Expand All @@ -1285,8 +1282,6 @@ Print help
param (
[Parameter(HelpMessage = "The URL of the directory where artifacts can be fetched from")]
[string]$ArtifactDownloadUrl = 'https://fake.axo.dev/faker/axolotlsay/fake-id-do-not-upload',
[Parameter(HelpMessage = "Don't add the install directory to PATH")]
[switch]$NoModifyPath,
[Parameter(HelpMessage = "Print Help")]
[switch]$Help
)
Expand All @@ -1305,7 +1300,13 @@ if ($env:AXOLOTLSAY_DISABLE_UPDATE) {
$install_updater = $true
}

$NoModifyPath = $false
if ($env:AXOLOTLSAY_NO_MODIFY_PATH) {
$NoModifyPath = $true
}

$unmanaged_install = $env:AXOLOTLSAY_UNMANAGED_INSTALL

if ($unmanaged_install) {
$NoModifyPath = $true
$install_updater = $false
Expand Down
11 changes: 6 additions & 5 deletions cargo-dist/tests/snapshots/axolotlsay_abyss_only.snap
Original file line number Diff line number Diff line change
Expand Up @@ -1274,9 +1274,6 @@ It will then add that dir to PATH by editing your Environment.Path registry key
.PARAMETER ArtifactDownloadUrl
The URL of the directory where artifacts can be fetched from

.PARAMETER NoModifyPath
Don't add the install directory to PATH

.PARAMETER Help
Print help

Expand All @@ -1285,8 +1282,6 @@ Print help
param (
[Parameter(HelpMessage = "The URL of the directory where artifacts can be fetched from")]
[string]$ArtifactDownloadUrl = 'https://fake.axo.dev/faker/axolotlsay/fake-id-do-not-upload',
[Parameter(HelpMessage = "Don't add the install directory to PATH")]
[switch]$NoModifyPath,
[Parameter(HelpMessage = "Print Help")]
[switch]$Help
)
Expand All @@ -1305,7 +1300,13 @@ if ($env:AXOLOTLSAY_DISABLE_UPDATE) {
$install_updater = $true
}

$NoModifyPath = $false
if ($env:AXOLOTLSAY_NO_MODIFY_PATH) {
$NoModifyPath = $true
}

$unmanaged_install = $env:AXOLOTLSAY_UNMANAGED_INSTALL

if ($unmanaged_install) {
$NoModifyPath = $true
$install_updater = $false
Expand Down
11 changes: 6 additions & 5 deletions cargo-dist/tests/snapshots/axolotlsay_alias.snap
Original file line number Diff line number Diff line change
Expand Up @@ -1302,9 +1302,6 @@ It will then add that dir to PATH by editing your Environment.Path registry key
.PARAMETER ArtifactDownloadUrl
The URL of the directory where artifacts can be fetched from

.PARAMETER NoModifyPath
Don't add the install directory to PATH

.PARAMETER Help
Print help

Expand All @@ -1313,8 +1310,6 @@ Print help
param (
[Parameter(HelpMessage = "The URL of the directory where artifacts can be fetched from")]
[string]$ArtifactDownloadUrl = 'https://github.com/axodotdev/axolotlsay/releases/download/v0.2.2',
[Parameter(HelpMessage = "Don't add the install directory to PATH")]
[switch]$NoModifyPath,
[Parameter(HelpMessage = "Print Help")]
[switch]$Help
)
Expand All @@ -1333,7 +1328,13 @@ if ($env:AXOLOTLSAY_DISABLE_UPDATE) {
$install_updater = $true
}

$NoModifyPath = $false
if ($env:AXOLOTLSAY_NO_MODIFY_PATH) {
$NoModifyPath = $true
}

$unmanaged_install = $env:AXOLOTLSAY_UNMANAGED_INSTALL

if ($unmanaged_install) {
$NoModifyPath = $true
$install_updater = $false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1306,9 +1306,6 @@ It will then add that dir to PATH by editing your Environment.Path registry key
.PARAMETER ArtifactDownloadUrl
The URL of the directory where artifacts can be fetched from

.PARAMETER NoModifyPath
Don't add the install directory to PATH

.PARAMETER Help
Print help

Expand All @@ -1317,8 +1314,6 @@ Print help
param (
[Parameter(HelpMessage = "The URL of the directory where artifacts can be fetched from")]
[string]$ArtifactDownloadUrl = 'https://github.com/axodotdev/axolotlsay/releases/download/v0.2.2',
[Parameter(HelpMessage = "Don't add the install directory to PATH")]
[switch]$NoModifyPath,
[Parameter(HelpMessage = "Print Help")]
[switch]$Help
)
Expand All @@ -1337,7 +1332,13 @@ if ($env:AXOLOTLSAY_DISABLE_UPDATE) {
$install_updater = $true
}

$NoModifyPath = $false
if ($env:AXOLOTLSAY_NO_MODIFY_PATH) {
$NoModifyPath = $true
}

$unmanaged_install = $env:AXOLOTLSAY_UNMANAGED_INSTALL

if ($unmanaged_install) {
$NoModifyPath = $true
$install_updater = $false
Expand Down
11 changes: 6 additions & 5 deletions cargo-dist/tests/snapshots/axolotlsay_basic.snap
Original file line number Diff line number Diff line change
Expand Up @@ -1274,9 +1274,6 @@ It will then add that dir to PATH by editing your Environment.Path registry key
.PARAMETER ArtifactDownloadUrl
The URL of the directory where artifacts can be fetched from

.PARAMETER NoModifyPath
Don't add the install directory to PATH

.PARAMETER Help
Print help

Expand All @@ -1285,8 +1282,6 @@ Print help
param (
[Parameter(HelpMessage = "The URL of the directory where artifacts can be fetched from")]
[string]$ArtifactDownloadUrl = 'https://github.com/axodotdev/axolotlsay/releases/download/v0.2.2',
[Parameter(HelpMessage = "Don't add the install directory to PATH")]
[switch]$NoModifyPath,
[Parameter(HelpMessage = "Print Help")]
[switch]$Help
)
Expand All @@ -1305,7 +1300,13 @@ if ($env:AXOLOTLSAY_DISABLE_UPDATE) {
$install_updater = $true
}

$NoModifyPath = $false
if ($env:AXOLOTLSAY_NO_MODIFY_PATH) {
$NoModifyPath = $true
}

$unmanaged_install = $env:AXOLOTLSAY_UNMANAGED_INSTALL

if ($unmanaged_install) {
$NoModifyPath = $true
$install_updater = $false
Expand Down
11 changes: 6 additions & 5 deletions cargo-dist/tests/snapshots/axolotlsay_basic_lies.snap
Original file line number Diff line number Diff line change
Expand Up @@ -1277,9 +1277,6 @@ It will then add that dir to PATH by editing your Environment.Path registry key
.PARAMETER ArtifactDownloadUrl
The URL of the directory where artifacts can be fetched from

.PARAMETER NoModifyPath
Don't add the install directory to PATH

.PARAMETER Help
Print help

Expand All @@ -1288,8 +1285,6 @@ Print help
param (
[Parameter(HelpMessage = "The URL of the directory where artifacts can be fetched from")]
[string]$ArtifactDownloadUrl = 'https://github.com/axodotdev/axolotlsay/releases/download/v0.2.2',
[Parameter(HelpMessage = "Don't add the install directory to PATH")]
[switch]$NoModifyPath,
[Parameter(HelpMessage = "Print Help")]
[switch]$Help
)
Expand All @@ -1308,7 +1303,13 @@ if ($env:AXOLOTLSAY_DISABLE_UPDATE) {
$install_updater = $true
}

$NoModifyPath = $false
if ($env:AXOLOTLSAY_NO_MODIFY_PATH) {
$NoModifyPath = $true
}

$unmanaged_install = $env:AXOLOTLSAY_UNMANAGED_INSTALL

if ($unmanaged_install) {
$NoModifyPath = $true
$install_updater = $false
Expand Down
11 changes: 6 additions & 5 deletions cargo-dist/tests/snapshots/axolotlsay_build_setup_steps.snap
Original file line number Diff line number Diff line change
Expand Up @@ -1274,9 +1274,6 @@ It will then add that dir to PATH by editing your Environment.Path registry key
.PARAMETER ArtifactDownloadUrl
The URL of the directory where artifacts can be fetched from

.PARAMETER NoModifyPath
Don't add the install directory to PATH

.PARAMETER Help
Print help

Expand All @@ -1285,8 +1282,6 @@ Print help
param (
[Parameter(HelpMessage = "The URL of the directory where artifacts can be fetched from")]
[string]$ArtifactDownloadUrl = 'https://github.com/axodotdev/axolotlsay/releases/download/v0.2.2',
[Parameter(HelpMessage = "Don't add the install directory to PATH")]
[switch]$NoModifyPath,
[Parameter(HelpMessage = "Print Help")]
[switch]$Help
)
Expand All @@ -1305,7 +1300,13 @@ if ($env:AXOLOTLSAY_DISABLE_UPDATE) {
$install_updater = $true
}

$NoModifyPath = $false
if ($env:AXOLOTLSAY_NO_MODIFY_PATH) {
$NoModifyPath = $true
}

$unmanaged_install = $env:AXOLOTLSAY_UNMANAGED_INSTALL

if ($unmanaged_install) {
$NoModifyPath = $true
$install_updater = $false
Expand Down
Loading

0 comments on commit b2cf35c

Please sign in to comment.