1
Fork 0
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:
WindSoilder 2022-08-05 15:47:18 +08:00 committed by GitHub
parent ea7de87315
commit a34f173181
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 99 additions and 99 deletions

View file

@ -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
}