Skip to content
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

Closed
wants to merge 37 commits into from
Closed

Conversation

oklopfer
Copy link
Member

@oklopfer oklopfer commented Dec 11, 2023

should have a pacstall-programs merge that adds pacdeps=("nu-tongues-bin") at same time this is merged as well

wren54 added 16 commits December 2, 2023 21:54
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 {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
let first_table = if $desc == true {
let first_table = if $desc == true {

Comment on lines +39 to +42




Copy link
Member

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))}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$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}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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
Comment on lines 526 to 529




Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove these.



}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

@Elsie19 Elsie19 mentioned this pull request Dec 11, 2023
@Elsie19 Elsie19 linked an issue Dec 11, 2023 that may be closed by this pull request
@oklopfer
Copy link
Member Author

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"
Copy link
Member Author

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

rhino-pkg Show resolved Hide resolved
@Elsie19
Copy link
Member

Elsie19 commented Dec 18, 2023

@oklopfer any updates on the changes I suggested?

@oklopfer oklopfer assigned Elsie19 and unassigned oklopfer Dec 18, 2023
@oklopfer
Copy link
Member Author

Yeah, you haven’t done any of them yet. It’s your project, Elsie. You maintain it. Not me.

@Elsie19
Copy link
Member

Elsie19 commented Dec 18, 2023

It's your PR but fine.

@oklopfer
Copy link
Member Author

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
@Elsie19
Copy link
Member

Elsie19 commented Nov 1, 2024

This one isn't happening, but look at https://github.com/Elsie19/rpk2

@Elsie19 Elsie19 closed this Nov 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

rework: switch to rhinu-pkg
3 participants