-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rewrite: switch to nushell #38
Conversation
update rhino-pkg to be nushell with references to the nushell plugin
add dir to put new translations, created format for translations
corrected translation dir path
fixed [y/N] not behaving as intended
re-fixing translation dir path
Added multiple search terms for searching and installs added more robust command checking added aliases
added more aliases
added input filtering to install and remove added the ability to select multiple packages for install and remove
corresponds to previous rhino-pkg commit adding input filtering to install and remove
Solved pacstall error when no packages
Added --multiterm Added sequential search, install and remove Cleaned up functions
Forgot final edit to the help function
|
||
def search-apt [input: string, desc: bool] -> table { | ||
if (cmd-exist 'apt-cache') { | ||
let first_table = if $desc == true { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let first_table = if $desc == true { | |
let first_table = if $desc == true { |
|
||
|
||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Delete these lines.
def prune-search-table [prune_term: string] -> table { | ||
let input_table: table = $in | ||
let downcase_prune_term = ($prune_term |str downcase) | ||
$input_table | filter { |row| (($row.package | into string | str downcase | str contains $downcase_prune_term) or ($row.description | into string | str downcase | str contains $downcase_prune_term))} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$input_table | filter { |row| (($row.package | into string | str downcase | str contains $downcase_prune_term) or ($row.description | into string | str downcase | str contains $downcase_prune_term))} | |
$input_table | filter { |row| (($row.package | into string | str downcase | str contains $downcase_prune_term) or ($row.description | into string | str downcase | str contains $downcase_prune_term)) } |
|
||
def search-pacstall [input: string] -> table { | ||
if (cmd-exist 'pacstall') { | ||
let pacstall = do { ^pacstall -S $input } | complete |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let pacstall = do { ^pacstall -S $input } | complete | |
let pacstall = do { ^pacstall -S $input } | complete |
if (cmd-exist 'tput') { | ||
$terminal_width = ((tput cols) | into int) | ||
} else if (cmd-exist 'stty') { | ||
$terminal_width = ((stty size| split column " ").column2.0 | into int) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$terminal_width = ((stty size| split column " ").column2.0 | into int) | |
$terminal_width = ((stty size | split column " ").column2.0 | into int) |
def search-cmd-no-args [ ] { | ||
let command: string = $in | ||
let error_msg = translation-dir-path | translate invalid.search-arguments {subcommand: $command} | ||
error make -u {msg: $error_msg} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
error make -u {msg: $error_msg} | |
error make -u { msg: $error_msg } |
] -> int { | ||
if ($rest | is-empty) { | ||
let error_msg = translation-dir-path | translate invalid.no-subcommand | ||
error make -u { msg: $error_msg} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
error make -u { msg: $error_msg} | |
error make -u { msg: $error_msg } |
} | ||
# "info" | "information" | "data" | "query" | "qry" | "q" => "info", | ||
if $command == "invalid" { | ||
let error_msg = translation-dir-path | translate invalid.subcommand {subcommand: $rest.0} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let error_msg = translation-dir-path | translate invalid.subcommand {subcommand: $rest.0} | |
let error_msg = translation-dir-path | translate invalid.subcommand { subcommand: $rest.0 } |
rhino-pkg
Outdated
|
||
|
||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove these.
|
||
|
||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makefile will also need to be edited for the tomls |
rhino-pkg
Outdated
individual packages. Has a confirmation prompt. | ||
#!/usr/bin/env nu | ||
def translation-dir-path [] -> string { | ||
"/usr/src/pacstall/rhino-pkg/translation_tomls" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is not a valid dir that will ever exist. it should be in a newly created /usr/local/share/rhino-pkg, not /usr/src/pacstall
@oklopfer any updates on the changes I suggested? |
Yeah, you haven’t done any of them yet. It’s your project, Elsie. You maintain it. Not me. |
It's your PR but fine. |
It’s also all @wren54 ‘s commits. I just made the PR so we could track it. |
moving from vm to bare metal
added the dir "nu-files" which includes the updated and split up rhino-pkg that references different files. Organizes the nu files into the rpk command and then helper scripts that multiple commands reference
should add functionality to detect changes in install dir also add correct makefile
changing makefile because make is fucked up
plugin add nu-tongues
This one isn't happening, but look at https://github.com/Elsie19/rpk2 |
should have a pacstall-programs merge that adds
pacdeps=("nu-tongues-bin")
at same time this is merged as well