goatfiles / nu_scripts Goto Github PK
View Code? Open in Web Editor NEWThe collection of `nushell` scripts for GOATs.
Home Page: https://goatfiles.github.io/
License: GNU General Public License v3.0
The collection of `nushell` scripts for GOATs.
Home Page: https://goatfiles.github.io/
License: GNU General Public License v3.0
i would like to add a vm clone
subcommand to clone VMs, just as can be done in managers such as virtualbox
๐
from amtoine/dotfiles#31
i would like to add the following kind of script to the nushell config:
# rm trough pipe # # Example # ls *.txt | first 5 | pipe rm export def "pipe rm" [] { if not ($in | is-empty) { get name | ansi strip | par-each {|file| rm -rf $file } | flatten } }
I would like to add a module, e.g. called tomb
, mainly a tomb manage
function, to easily interact with tomb
s ๐
until now, all the scripts assume the environment variables they use are set, either in env.nu
or in the current interactive shell with a manual let-env VAR = val
.
however, this is error prone when used on another config than man which sets all the variables, 'cause i use them
let vm_directory = ($env.QUICKEMU_HOME | path join $os)
in vm.nu#L54
would becomelet vm_directory = (
$env | get -i QUICKEMU_HOME | default "~/.local/share/quickemu" | path expand
| path join $os
)
let path = ($env.GHQ_ROOT | path join $repo)
in repo.nu#L100
would becomelet path = (
$env | get -i GHQ_ROOT | default "~/.local/share/ghq" | path expand
| path join $repo
)
from amtoine/dotfiles#32
there are a lot of
TODO
s in thenushell
modules...
namely i left the documentation undone intentionnally until... well now ๐i would like to complete all the documentation of the
nushell
modules and get rid of all theTODO
s ๐
that is a proposition, e.g. instead of having
Error:
ร User choose to exit...
โญโ[scripts/prompt.nu:27:1]
27 โ if ($choice | is-empty) {
28 โ error make (context user_choose_to_exit)
ยท โโโโโโฌโโโโ
ยท โฐโโ User choose to exit...
29 โ }
โฐโโโโ
when pressing <C-c>
inside the selection of repo goto
we could have a simpler
User choose to exit...
when i cd
to /tmp/
, even /tmp/foo/
, i get
Error: nu::shell::eval_block_with_input (link)
ร Eval block failed with pipeline input
โญโ[scripts/shell_prompt.nu:12:1]
12 โ $"!/($env.PWD)" |
13 โ str replace $"!/($home)" ~ -s |
ยท โโโโโโฌโโโโโ
ยท โฐโโ source value
14 โ split row $sep
โฐโโโโ
Error: nu::shell::access_beyond_end (link)
ร Row number too large (empty content).
โญโ[scripts/shell_prompt.nu:24:1]
24 โ $el
25 โ } else if ($spwd_src.0 == ".") {
ยท โฌ
ยท โฐโโ index too large (empty content)
26 โ $".($spwd_src.1)"
โฐโโโโ
We discussed this here nushell/nushell#8583 (comment). Excerpt below.
https://github.com/goatfiles/nu_scripts/blob/bleeding/scripts/plugin.nu
@amtoine I noticed that this script isn't cross platform. It doesn't really matter for you, but if someone on Windows wants to use this, they need to change this line:
| str replace '^register (.*) \s+{' '{"binary": "$1",'
to something more like this
| str replace '^register (.*) \s+{' `{"binary": '$1',`
notice the difference is "$1"
vs '$1'
. Double quotes means to interpret escapes, which is fine for *nix, but on Windows where paths are like C:\some\path
, all that mess is now escaped because of double quotes.
i would like to refactor the scripts a bit, mainly
|
pipe symbol at the beginning of the lines instead of the endfor instance, to change
start-of-pipe |
command-1 |
command-2 |
end-of-pipe
one would have to make sure the |
is added to the last command and removed from others when shuffling
with
start-of-pipe
| command-1
| command-2
| end-of-pipe
one can shuffle and remove any of the last three commands without ever breaking the pipeline itself ๐
I would like to add a module, e.g. called trash
, to interact with the freedesktop trash functionnality activated by the $env.config.rm.always_trash
option.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.