Giter Club home page Giter Club logo

Comments (6)

acidghost avatar acidghost commented on June 8, 2024 2

@Canop @fnuttens I think this can be closed because of #786

from broot.

Canop avatar Canop commented on June 8, 2024 1

See #786

There's a huge retro-compatibility problem in nushell: it doesn't have a solution for having a script which works correctly (without printing warnings) in both the current version and previous ones.

from broot.

fnuttens avatar fnuttens commented on June 8, 2024

@Canop
The deprecation is only soft for this release, thus resulting in warnings like you said. In the meantime, I simply sed broot's init script in my config.

I guess the maintainers choose to deprecate things relatively fast because nu is not stable (1.0) yet.

from broot.

Canop avatar Canop commented on June 8, 2024

The problem is that a warning is a breaking change when it's in a script. If only there was a way to disable those warnings similar to the 'allow' that we have in Rust (maybe there is, I don't know nu well enough)

from broot.

charlesroper avatar charlesroper commented on June 8, 2024

I put this temporary fix in my config.nu

(open ~/AppData/Roaming/dystroy/broot/config/launcher/nushell/br 
	| str replace --all 'def-env ' 'def --env ' 
	| save --force ~/AppData/Roaming/dystroy/broot/config/launcher/nushell/br)

source ~/AppData/Roaming/dystroy/broot/config/launcher/nushell/br

That's on Windows. On Linux, the br file is in: ~/.config/broot/launcher/nushell/br

from broot.

dvbnrg avatar dvbnrg commented on June 8, 2024

I've managed to get past this issue with the following:

pretty much all I'm doing is changing the def-env to let-env and then adding a couple '='

`
let-env br = [
--cmd(-c): string # Semicolon separated commands to execute
--color: string = "auto" # Whether to have styles and colors (auto is default and usually OK) [possible values: auto, yes, no]
--conf: string # Semicolon separated paths to specific config files"),
--dates(-d) # Show the last modified date of files and directories"
--no-dates(-D) # Don't show the last modified date"
--only-folders(-f) # Only show folders
--no-only-folders(-F) # Show folders and files alike
--show-git-info(-g) # Show git statuses on files and stats on repo
--no-show-git-info(-G) # Don't show git statuses on files and stats on repo
--git-status # Only show files having an interesting git status, including hidden ones
--hidden(-h) # Show hidden files
--no-hidden(-H) # Don't show hidden files
--height: int # Height (if you don't want to fill the screen or for file export)
--help # Print help information
--git-ignored(-i) # Show git ignored files
--no-git-ignored(-I) # Don't show git ignored files
--install # Install or reinstall the br shell function
--no-sort # Don't sort
--permissions(-p) # Show permissions
--no-permissions(-P) # Don't show permissions
--print-shell-function: string # Print to stdout the br function for a given shell
--sizes(-s) # Show the size of files and directories
--no-sizes(-S) # Don't show sizes
--set-install-state: path # Where to write the produced cmd (if any) [possible values: undefined, refused, installed]
--show-root-fs # Show filesystem info on top
--sort-by-count # Sort by count (only show one level of the tree)
--sort-by-date # Sort by date (only show one level of the tree)
--sort-by-size # Sort by size (only show one level of the tree)
--sort-by-type # Same as sort-by-type-dirs-first
--sort-by-type-dirs-first # Sort by type, directories first (only show one level of the tree)
--sort-by-type-dirs-last # Sort by type, directories last (only show one level of the tree)
--trim-root(-t) # Trim the root too and don't show a scrollbar
--no-trim-root(-T) # Don't trim the root level, show a scrollbar
--version(-V) # Print version information
--whale-spotting(-w) # Sort by size, show ignored and hidden files
--write-default-conf: path # Write default conf files in given directory
file?: path # Root Directory
] = {
mut args = []
if $cmd != null { $args = ($args | append $'--cmd=($cmd)') }
if $color != null { $args = ($args | append $'--color=($color)') }
if $conf != null { $args = ($args | append $'--conf=($conf)') }
if $dates { $args = ($args | append $'--dates') }
if $no_dates { $args = ($args | append $'--no-dates') }
if $only_folders { $args = ($args | append $'--only-folders') }
if $no_only_folders { $args = ($args | append $'--no-only-folders') }
if $show_git_info { $args = ($args | append $'--show-git-info') }
if $no_show_git_info { $args = ($args | append $'--no-show-git-info') }
if $git_status { $args = ($args | append $'--git-status') }
if $hidden { $args = ($args | append $'--hidden') }
if $no_hidden { $args = ($args | append $'--no-hidden') }
if $height != null { $args = ($args | append $'--height=($height)') }
if $help { $args = ($args | append $'--help') }
if $git_ignored { $args = ($args | append $'--git-ignored') }
if $no_git_ignored { $args = ($args | append $'--no-git-ignored') }
if $install { $args = ($args | append $'--install') }
if $no_sort { $args = ($args | append $'--no-sort') }
if $permissions { $args = ($args | append $'--permissions') }
if $no_permissions { $args = ($args | append $'--no-permissions') }
if $print_shell_function != null { $args = ($args | append $'--print-shell-function=($print_shell_function)') }
if $sizes { $args = ($args | append $'--sizes') }
if $no_sizes { $args = ($args | append $'--no-sizes') }
if $set_install_state != null { $args = ($args | append $'--set-install-state=($set_install_state)') }
if $show_root_fs { $args = ($args | append $'--show-root-fs') }
if $sort_by_count { $args = ($args | append $'--sort-by-count') }
if $sort_by_date { $args = ($args | append $'--sort-by-date') }
if $sort_by_size { $args = ($args | append $'--sort-by-size') }
if $sort_by_type { $args = ($args | append $'--sort-by-type') }
if $sort_by_type_dirs_first { $args = ($args | append $'--sort-by-type-dirs-first') }
if $sort_by_type_dirs_last { $args = ($args | append $'--sort-by-type-dirs-last') }
if $trim_root { $args = ($args | append $'--trim-root') }
if $no_trim_root { $args = ($args | append $'--no-trim-root') }
if $version { $args = ($args | append $'--version') }
if $whale_spotting { $args = ($args | append $'--whale-spotting') }
if $write_default_conf != null { $args = ($args | append $'--write-default-conf=($write_default_conf)') }

let cmd_file = ([ $nu.temp-path, $"broot-(random chars).tmp" ] | path join)
touch $cmd_file
if ($file == null) {
    ^broot --outcmd $cmd_file $args
} else {
    ^broot --outcmd $cmd_file $args $file
}
let $cmd = (open $cmd_file)
rm -p -f $cmd_file

if (not ($cmd | lines | is-empty)) {
    cd ($cmd | parse -r `^cd\s+(?<quote>"|'|)(?<path>.+)\k<quote>[\s\r\n]*$` | get path | to text)
}

}
`

from broot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.