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

refactor: Rework #1

Draft
wants to merge 28 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
0125606
style: Format
Ash258 Jan 9, 2022
5360223
chore: Change URLS
Ash258 Jan 9, 2022
46daaed
style: Small tweaks
Ash258 Jan 9, 2022
f285a62
feat: Support installation via git if installed
Ash258 Jan 9, 2022
297ff0b
feat: Install base bucket
Ash258 Jan 9, 2022
93915e2
feat: Add ScoopBranch parameter
Ash258 Jan 9, 2022
a8efa73
feat: Add `SkipRobocopy` parameter
Ash258 Jan 9, 2022
7fa31e9
feat: Support installation from locally cached zip archives
Ash258 Jan 9, 2022
f8258fa
style: Unify
Ash258 Jan 9, 2022
c512dc3
chore: Extract download/extract to function
Ash258 Jan 13, 2022
60b20ac
style: Lint
Ash258 Jan 13, 2022
795f204
fix: Fail when HOME/USERPROFILE does not exist
Ash258 Jan 13, 2022
f2eb3c1
style: Break after git cloning to keep rest cleaner
Ash258 Jan 13, 2022
e001b7d
fix: Properly suport extraction of any core zip
Ash258 Jan 13, 2022
b7c3a3e
fix: Save all needed config options
Ash258 Jan 13, 2022
d10ce20
feat: Suport caching of zips `-InstallerCacheDir`
Ash258 Jan 14, 2022
53a46ef
fix: lastUpdate format
Ash258 Jan 14, 2022
45847e0
feat: Add global shim directory to global path if administrator
Ash258 Jan 14, 2022
9ac1fe0
fix: Configure SCOOP, SCOOP_GLOBAL, SCOOP_CACHE allways
Ash258 Jan 14, 2022
94e5aa8
fix: Configure current shell envs
Ash258 Jan 15, 2022
b944a5a
try to cast with string param. Consider remove type of $Value
Ash258 Jan 15, 2022
40651e1
handle path in nanoserver
Ash258 Jan 28, 2022
bafc683
Merge branch 'main' into NEW
Ash258 Jan 29, 2022
86df096
Merge branch 'main' into NEW
Ash258 Jan 29, 2022
1542a11
Merge branch 'main' into NEW
Ash258 Jan 29, 2022
38ad007
Merge branch 'main' into NEW
Ash258 Jan 29, 2022
8b84f82
Merge branch 'main' of github.com:shovel-org/Install into NEW
Ash258 May 6, 2023
ea25964
fix
Ash258 May 6, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
handle path in nanoserver
  • Loading branch information
Ash258 committed Jan 28, 2022
commit 40651e11edae39ff65affa6f13ca76555a4d7ef2
22 changes: 17 additions & 5 deletions install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,7 @@ function Get-Env {
function Add-ShimsDirToPath {
# Get $env:PATH of current user
$userEnvPath = Get-Env 'PATH'
$newUserEnvPath = "$SCOOP_SHIMS_DIR;$userEnvPath"

if ($userEnvPath -notmatch [Regex]::Escape($SCOOP_SHIMS_DIR)) {
$h = (Get-PSProvider 'FileSystem').Home
Expand All @@ -365,22 +366,33 @@ function Add-ShimsDirToPath {
}

# For future sessions
[System.Environment]::SetEnvironmentVariable('PATH', "$SCOOP_SHIMS_DIR;$userEnvPath", 'User')
[System.Environment]::SetEnvironmentVariable('PATH', $userEnvPath, 'User')
# For current session
$env:PATH = "$SCOOP_SHIMS_DIR;$env:PATH"
$env:PATH = $userEnvPath
}

# Get $env:PATH of machine
$globalEnvPath = Get-Env 'PATH' -global
$newGlobalEnvPath = "${SCOOP_GLOBAL_SHIMS_DIR};${globalEnvPath}"

if ($globalEnvPath -notmatch [Regex]::Escape($SCOOP_GLOBAL_SHIMS_DIR)) {
if (Test-IsAdministrator) {
Write-InstallInfo "Adding ${SCOOP_GLOBAL_SHIMS_DIR} to system-wide PATH."
# For future sessions
[System.Environment]::SetEnvironmentVariable('PATH', "${SCOOP_GLOBAL_SHIMS_DIR};${globalEnvPath}", 'Machine')
[System.Environment]::SetEnvironmentVariable('PATH', $newGlobalEnvPath, 'Machine')
# For current session
$env:PATH = "${env:PATH};${SCOOP_GLOBAL_SHIMS_DIR}"
$env:PATH = $newGlobalEnvPath
}
}

# Nanoserver does not have user specific path
if ($env:POWERSHELL_DISTRIBUTION_CHANNEL -like '*nanoserver*') {
$newGlobalEnvPath = "${SCOOP_SHIMS_DIR};$newGlobalEnvPath"
# For future sessions
[System.Environment]::SetEnvironmentVariable('PATH', $newGlobalEnvPath, 'Machine')
# For current session
$env:PATH = $newGlobalEnvPath
}
}

function Use-Config {
Expand All @@ -400,7 +412,7 @@ function Add-Config {
[Parameter(Mandatory, Position = 0)]
[String] $Name,
[Parameter(Mandatory, Position = 1)]
[String] $Value
$Value
)

$scoopConfig = Use-Config
Expand Down