mirror of
https://github.com/RGBCube/nu_scripts
synced 2025-07-31 14:17:45 +00:00
Migrate some scripts to fit new variable and arguments naming style (#268)
* add tmp script * fix more scripts * remove tmp file * migrate to new variable definition * rename builtin variable back
This commit is contained in:
parent
ea7de87315
commit
a34f173181
10 changed files with 99 additions and 99 deletions
|
@ -30,7 +30,7 @@ export env SHOW_USR { "true" }
|
|||
# prompt
|
||||
export env PROMPT_COMMAND { "build-prompt" }
|
||||
export def build-prompt [] {
|
||||
let usr-str = (if $env.SHOW_USR == "true" {
|
||||
let usr_str = (if $env.SHOW_USR == "true" {
|
||||
[
|
||||
$env.USER
|
||||
'@'
|
||||
|
@ -41,11 +41,11 @@ export def build-prompt [] {
|
|||
''
|
||||
})
|
||||
|
||||
let pwd-str = (if (pwd | str starts-with $env.HOME).0 {
|
||||
let pwd_str = (if (pwd | str starts-with $env.HOME).0 {
|
||||
(pwd | str replace $env.HOME '~' | str trim).0
|
||||
} else {
|
||||
pwd
|
||||
})
|
||||
|
||||
[ $usr-str $pwd-str ' ' ] | str collect
|
||||
[ $usr_str $pwd_str ' ' ] | str collect
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue