mirror of
https://github.com/cmderdev/cmder.git
synced 2025-06-15 22:27:51 +08:00
auto generate cmd user_init.cmd
This commit is contained in:
19
vendor/bin/create-cmdercfg.ps1
vendored
Normal file
19
vendor/bin/create-cmdercfg.ps1
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
[CmdletBinding()]
|
||||
param(
|
||||
[Parameter()]
|
||||
[string]$shell = 'cmd',
|
||||
[string]$outfile = "$env:cmder_root\config\user_init.cmd"
|
||||
)
|
||||
|
||||
$CmderModulePath = Join-path $env:cmder_root "vendor/psmodules/"
|
||||
$CmderFunctions = Join-Path $CmderModulePath "Cmder.ps1"
|
||||
. $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!"
|
||||
}
|
Reference in New Issue
Block a user