Install vscode
extensions by default
This commit is contained in:
parent
bf9757043a
commit
a9daaa9d2b
4 changed files with 57 additions and 15 deletions
26
scripts/Common/Software/vscode/Main.ps1
Normal file
26
scripts/Common/Software/vscode/Main.ps1
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
param(
|
||||||
|
$Action,
|
||||||
|
[hashtable] $Arguments
|
||||||
|
)
|
||||||
|
|
||||||
|
. "$PSScriptRoot/../../../Common/Scripts/Software.ps1";
|
||||||
|
. "$PSScriptRoot/../../../Common/Scripts/SoftwareManagement.ps1";
|
||||||
|
|
||||||
|
Start-SoftwareInstaller @PSBoundParameters `
|
||||||
|
-UserConfigurator {
|
||||||
|
param(
|
||||||
|
$Arguments
|
||||||
|
)
|
||||||
|
|
||||||
|
$bins = @("codium", "codium-insiders", "code", "code-insiders");
|
||||||
|
$extensions = @("zokugun.sync-settings", "zokugun.vsix-manager");
|
||||||
|
$user = $Arguments.Name;
|
||||||
|
|
||||||
|
foreach ($bin in $bins) {
|
||||||
|
if (Test-Command "$bin") {
|
||||||
|
foreach ($extension in $extensions) {
|
||||||
|
sudo -u "$user" "$bin" --install-extension "$extension";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
|
@ -2,19 +2,9 @@
|
||||||
begin
|
begin
|
||||||
set -l dir (status dirname)
|
set -l dir (status dirname)
|
||||||
source "$dir/../../Scripts/software.fish"
|
source "$dir/../../Scripts/software.fish"
|
||||||
source "$dir/../../../Common/Software/aliae/main.fish"
|
|
||||||
|
|
||||||
function userConfig -a name
|
function userConfig -V dir -a name
|
||||||
set -l bins codium codium-insiders code code-insiders
|
pwsh "$dir/Main.ps1" ConfigureUser;
|
||||||
set -l extensions zokugun.{sync-settings,vsix-manager}
|
|
||||||
|
|
||||||
for bin in $bins
|
|
||||||
if type -q "$bin"
|
|
||||||
for extension in $extensions
|
|
||||||
sudo -u "$name" "$bin" --install-extension "$extension"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
runInstaller $argv
|
runInstaller $argv
|
||||||
|
|
|
@ -458,9 +458,6 @@ $null = New-Module {
|
||||||
|
|
||||||
if (Test-Collection "coding") {
|
if (Test-Collection "coding") {
|
||||||
if ($install) {
|
if ($install) {
|
||||||
Install-ChocoPackage vscode -ArgumentList "--params","/NoDesktopIcon";
|
|
||||||
Install-ChocoPackage vscodium -ArgumentList "--params","/NoDesktopIcon /AssociateWithFiles";
|
|
||||||
|
|
||||||
Install-ChocoPackage `
|
Install-ChocoPackage `
|
||||||
gh `
|
gh `
|
||||||
github-desktop `
|
github-desktop `
|
||||||
|
@ -476,6 +473,7 @@ $null = New-Module {
|
||||||
Remove-DesktopIcon "Docker*";
|
Remove-DesktopIcon "Docker*";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
& "$softwarePath/vscode/Main.ps1" @arguments;
|
||||||
& "$softwarePath/VisualStudio/Manage.ps1" @arguments;
|
& "$softwarePath/VisualStudio/Manage.ps1" @arguments;
|
||||||
|
|
||||||
# Node.js
|
# Node.js
|
||||||
|
|
28
scripts/Windows/Software/vscode/Main.ps1
Normal file
28
scripts/Windows/Software/vscode/Main.ps1
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
param(
|
||||||
|
$Action,
|
||||||
|
[hashtable] $Arguments
|
||||||
|
)
|
||||||
|
|
||||||
|
& {
|
||||||
|
param (
|
||||||
|
[hashtable] $Parameters
|
||||||
|
)
|
||||||
|
|
||||||
|
. "$PSScriptRoot/../../../Common/Scripts/Software.ps1";
|
||||||
|
. "$PSScriptRoot/../../../Common/Types/InstallerAction.ps1";
|
||||||
|
$base = "$PSScriptRoot/../../../Common/Software/vscode/Main.ps1";
|
||||||
|
|
||||||
|
Start-SoftwareInstaller @Parameters `
|
||||||
|
-Installer {
|
||||||
|
Install-ChocoPackage vscode -ArgumentList "--params","/NoDesktopIcon";
|
||||||
|
Install-ChocoPackage vscodium -ArgumentList "--params","/NoDesktopIcon /AssociateWithFiles";
|
||||||
|
refreshenv;
|
||||||
|
} `
|
||||||
|
-UserConfigurator {
|
||||||
|
param(
|
||||||
|
$Arguments
|
||||||
|
)
|
||||||
|
|
||||||
|
& $base ([InstallerAction]::ConfigureUser) @PSBoundParameters;
|
||||||
|
};
|
||||||
|
} $PSBoundParameters;
|
Loading…
Reference in a new issue