cmder/vendor/bin/create-cmdercfg.ps1

31 lines
886 B
PowerShell
Raw Normal View History

2023-02-13 01:48:27 +08:00
[CmdletBinding()]
param(
[Parameter()]
[string]$shell = 'cmd',
2023-07-04 04:19:07 +08:00
[string]$outfile = "$env:cmder_config_dir\user_init.cmd"
2023-02-13 01:48:27 +08:00
)
2023-07-04 04:19:07 +08:00
if ($shell -match 'powershell') {
write-host "'$shell' is not supported at this time!"
exit 0
} elseif ($shell -match 'bash') {
write-host "'$shell' is not supported at this time!"
exit 0
2023-07-04 04:36:57 +08:00
} elseif ($shell -notMatch 'cmd') {
2023-07-04 04:23:45 +08:00
exit 0
2023-07-04 04:19:07 +08:00
}
2023-02-13 01:48:27 +08:00
$CmderModulePath = Join-path $env:cmder_root "vendor/psmodules/"
$CmderFunctions = Join-Path $CmderModulePath "Cmder.ps1"
2023-07-04 04:19:07 +08:00
2023-02-13 01:48:27 +08:00
. $CmderFunctions
if ($shell -match 'cmd') {
write-host "Generating Cmder Config for '$shell' shell in '$outfile'..."
templateExpand "$env:cmder_root\vendor\user_init.cmd.template" "$outfile"
} elseif ($shell -match 'powershell') {
write-host "'$shell' is not supported at this time!"
} elseif ($shell -match 'bash') {
write-host "'$shell' is not supported at this time!"
}