Add PowerShell install script
This commit is contained in:
parent
5294594f5a
commit
727217fbc5
22
tools/git-submodule/install.ps1
Normal file
22
tools/git-submodule/install.ps1
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
$ErrorActionPreference = "Stop"
|
||||||
|
|
||||||
|
$CONFIG = "install.conf.yaml"
|
||||||
|
$DOTBOT_DIR = "dotbot"
|
||||||
|
|
||||||
|
$DOTBOT_BIN = "bin/dotbot"
|
||||||
|
$BASEDIR = $PSScriptRoot
|
||||||
|
|
||||||
|
Set-Location $BASEDIR
|
||||||
|
git -C $DOTBOT_DIR submodule sync --quiet --recursive
|
||||||
|
git submodule update --init --recursive $DOTBOT_DIR
|
||||||
|
|
||||||
|
foreach ($PYTHON in ('python', 'python3', 'python2')) {
|
||||||
|
# Python redirects to Microsoft Store in Windows 10 when not installed
|
||||||
|
if (& { $ErrorActionPreference = "SilentlyContinue"
|
||||||
|
![string]::IsNullOrEmpty((&$PYTHON -V))
|
||||||
|
$ErrorActionPreference = "Stop" }) {
|
||||||
|
&$PYTHON $(Join-Path $BASEDIR $DOTBOT_DIR $DOTBOT_BIN) -d $BASEDIR -c $CONFIG $Args
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Write-Error "Error: Cannot find Python."
|
21
tools/hg-subrepo/install.ps1
Normal file
21
tools/hg-subrepo/install.ps1
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
$ErrorActionPreference = "Stop"
|
||||||
|
|
||||||
|
$CONFIG = "install.conf.yaml"
|
||||||
|
$DOTBOT_DIR = "dotbot"
|
||||||
|
|
||||||
|
$DOTBOT_BIN = "bin/dotbot"
|
||||||
|
$BASEDIR = $PSScriptRoot
|
||||||
|
|
||||||
|
Set-Location $BASEDIR
|
||||||
|
|
||||||
|
Set-Location $DOTBOT_DIR && git submodule update --init --recursive
|
||||||
|
foreach ($PYTHON in ('python', 'python3', 'python2')) {
|
||||||
|
# Python redirects to Microsoft Store in Windows 10 when not installed
|
||||||
|
if (& { $ErrorActionPreference = "SilentlyContinue"
|
||||||
|
![string]::IsNullOrEmpty((&$PYTHON -V))
|
||||||
|
$ErrorActionPreference = "Stop" }) {
|
||||||
|
&$PYTHON $(Join-Path $BASEDIR $DOTBOT_DIR $DOTBOT_BIN) -d $BASEDIR -c $CONFIG $Args
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Write-Error "Error: Cannot find Python."
|
Loading…
Reference in a new issue