Giter Club home page Giter Club logo

Comments (19)

Dominiquini avatar Dominiquini commented on June 14, 2024 2

https://github.com/Canop/broot/blob/4856d360c83ca0ac6a341afa577ec3e875de113c/src/shell_install/powershell.rs#L29C1-L29C1

Modify $($cmd_file.FullName) to

`"$($cmd_file.FullName)`"

maybe work

I was having the same issue:

File not found: "C:\\Users\\Rafael Dominiquini\\Dominiquini\\AppData\\Local\\Temp\\tmpudrel1.tmp"

But this suggestion (#788 (comment)) solve it!

Thanks.

from broot.

computerscience-person avatar computerscience-person commented on June 14, 2024 1

No, changed it since it contained my actual name.

It should look more something like this.

> br
File not found: "C:\\Users\\Name Surname\\Surname\\AppData\\Local\\Temp\\tmpC170.tmp"

It repeated the username after the first space.

from broot.

lost22git avatar lost22git commented on June 14, 2024 1

https://github.com/Canop/broot/blob/4856d360c83ca0ac6a341afa577ec3e875de113c/src/shell_install/powershell.rs#L29C1-L29C1

Modify $($cmd_file.FullName) to

`"$($cmd_file.FullName)`"

maybe work

from broot.

Canop avatar Canop commented on June 14, 2024 1

@2gn This is specific and looks actionable. Can you create a separate issue for that ?

from broot.

Canop avatar Canop commented on June 14, 2024

Is that the exact error message ? With "Username" ?

from broot.

Canop avatar Canop commented on June 14, 2024

The problem is probably in the way the shell script gives the path to broot but I don't know powershell well enough and I don't have any Windows box available so I need somebody else to try fix the script.

from broot.

Elkiwa avatar Elkiwa commented on June 14, 2024

I tried to reproduce this by creating a test user but can't even complete the br function install prerequisite. I wonder what should I do besides having a space in username?

Steps:

  1. Create a local user account
  2. Deliberately input the user name "test use"
  3. Install broot and try to install br function with sudo broot --install
PS C:\Users\test use> sudo broot --install
You requested a clean (re)install.
Removing C:\Users\test use\AppData\Roaming\dystroy\broot\data\launcher\bash\1.
Writing br shell function in C:\Users\test use\AppData\Roaming\dystroy\broot\data\launcher\bash\1.
Removing C:\Users\test use\AppData\Roaming\dystroy\broot\config\launcher\bash\br.
Creating link from C:\Users\test use\AppData\Roaming\dystroy\broot\config\launcher\bash\br to C:\Users\test use\AppData\Roaming\dystroy\broot\data\launcher\bash\1.

I found no sourcing file for the bash/zsh family.
If you're using bash or zsh, then installation isn't complete:
the br function initialization script won't be sourced unless you source it yourself.
PS C:\Users\test use>

P.S. The "I found no sourcing file for the bash/zsh family." warning is not problematic because the same happened to my real account but completed the br function installation onward in PowerShell.

from broot.

lost22git avatar lost22git commented on June 14, 2024

can you try the product compiled on my local machine?

broot.zip

  1. Remove the original broot
  2. Add the newly downloaded broot.exe path to env path
  3. broot --install
  4. Open new powershell window and run br

from broot.

Elkiwa avatar Elkiwa commented on June 14, 2024

can you try the product compiled on my local machine?

broot.zip

1. Remove the original broot

2. Add the newly downloaded broot.exe path to env path

3. `broot --install`

4. Open new powershell window and run `br`

Thank you for notice! The broot --install result is the same...

PS C:\Users\test use> broot --version
broot 1.27.1-dev
PS C:\Users\test use> br
br : The term 'br' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the
spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ br
+ ~~
    + CategoryInfo          : ObjectNotFound: (br:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

from broot.

lost22git avatar lost22git commented on June 14, 2024

@Elkiwa

You can check whether these two files exist and whether their contents are normal

  • C:\Users{username}\AppData\Roaming\dystroy\broot\config\launcher\powershell\br.ps1

  • C:\Users{username}\Documents\WindowsPowerShell\Profile.ps1

in my windows powershell

PS C:\Users\zzz> broot --install
You requested a clean (re)install.
Removing C:\Users\zzz\AppData\Roaming\dystroy\broot\config\launcher\installed-v4.
Removing C:\Users\zzz\AppData\Roaming\dystroy\broot\data\launcher\bash\1.
Writing br shell function in C:\Users\zzz\AppData\Roaming\dystroy\broot\data\launcher\bash\1.
Removing C:\Users\zzz\AppData\Roaming\dystroy\broot\config\launcher\bash\br.
Creating link from C:\Users\zzz\AppData\Roaming\dystroy\broot\config\launcher\bash\br to C:\Users\zzz\AppData\Roaming\dystroy\broot\data\launcher\bash\1.

I found no sourcing file for the bash/zsh family.
If you're using bash or zsh, then installation isn't complete:
the br function initialization script won't be sourced unless you source it
yourself.
Removing C:\Users\zzz\AppData\Roaming\dystroy\broot\data\launcher\nushell\4.
Writing br shell function in C:\Users\zzz\AppData\Roaming\dystroy\broot\data\launcher\nushell\4.
Removing C:\Users\zzz\AppData\Roaming\dystroy\broot\config\launcher\nushell\br.
Creating link from C:\Users\zzz\AppData\Roaming\dystroy\broot\config\launcher\nushell\br to C:\Users\zzz\AppData\Roaming\dystroy\broot\data\launcher\nushell\4.
C:\Users\zzz\AppData\Roaming\nushell\config.nu already patched, no change made.
Removing C:\Users\zzz\AppData\Roaming\dystroy\broot\data\launcher\powershell\1.
Writing br shell function in C:\Users\zzz\AppData\Roaming\dystroy\broot\data\launcher\powershell\1.
Removing C:\Users\zzz\AppData\Roaming\dystroy\broot\config\launcher\powershell\br.ps1.
Creating link from C:\Users\zzz\AppData\Roaming\dystroy\broot\config\launcher\powershell\br.ps1 to C:\Users\zzz\AppData\Roaming\dystroy\broot\data\launcher\powershell\1.
C:\Users\zzz\Documents\WindowsPowerShell\Profile.ps1 already patched, no change made.

The br function has been successfully installed.
You may have to restart your shell or source your shell init files.
Afterwards, you should start broot with br in order to use its full power.

but I guess you are probably using powershell core (aka. pwsh or PowerShell 7.x, cross platform)
Instead of Windows powershell (aka. PowerShell 5.1, windows built-in), broot --install does not yet support pwsh
You can try it using windows powershell

https://learn.microsoft.com/en-us/powershell/scripting/whats-new/differences-from-windows-powershell?view=powershell-7.3

from broot.

Elkiwa avatar Elkiwa commented on June 14, 2024

@Elkiwa

You can check whether these two files exist and whether their contents are normal

* C:\Users{username}\AppData\Roaming\dystroy\broot\config\launcher\powershell\br.ps1

* C:\Users{username}\Documents\WindowsPowerShell\Profile.ps1

Thank you. I'll try looking into it, though I'm not that familiar with PowerShell syntax.

but I guess you are probably using powershell core (aka. pwsh or PowerShell 7.x, cross platform) Instead of Windows powershell (aka. PowerShell 5.1, windows built-in), broot --install does not yet support pwsh You can try it using windows powershell

https://learn.microsoft.com/en-us/powershell/scripting/whats-new/differences-from-windows-powershell?view=powershell-7.3

Actually, I've already aware the difference of PowerShell and pwsh. All the above experiments are performed in PowerShell. My real Windows user account has br function installed in PowerShell, but I use pwsh whenever possible.

from broot.

lost22git avatar lost22git commented on June 14, 2024

@Elkiwa

If those two files are not generated, you can obtain the log file in the current directory by following the steps below:

  1. $env:BROOT_LOG='debug' ; broot --install
  2. cat broot.log

https://dystroy.org/broot/community/#log

from broot.

Elkiwa avatar Elkiwa commented on June 14, 2024

@lost22git Here comes the result.

PS C:\Users\test use> cat broot.log
00:55:56.454 [INFO] cli_log::init: Starting broot v1.27.1-dev with log level DEBUG
00:55:56.454 [DEBUG] broot: env::args(): [
    "C:\\Users\\test use\\broot\\broot.exe",
    "--install",
]
00:55:56.457 [INFO] broot::shell_install: Shell installation state: NotInstalled
00:55:56.457 [DEBUG] broot::shell_install: Starting install
00:55:56.457 [INFO] broot::shell_install: Writing `br` shell function in `"C:\\Users\\test use\\AppData\\Roaming\\dystroy\\broot\\data\\launcher\\bash\\1"`
00:55:56.458 [INFO] broot::shell_install: Creating link from "C:\\Users\\test use\\AppData\\Roaming\\dystroy\\broot\\config\\launcher\\bash\\br" to "C:\\Users\\test use\\AppData\\Roaming\\dystroy\\broot\\data\\launcher\\bash\\1"
00:55:56.461 [DEBUG] broot::shell_install::bash: considering path: "C:\\Users\\{real user}\\.bashrc"
00:55:56.461 [DEBUG] broot::shell_install::bash: considering path: "C:\\Users\\{real user}\\.bash_profile"
00:55:56.462 [DEBUG] broot::shell_install::bash: considering path: "C:\\Users\\{real user}\\.zshrc"
00:55:56.462 [DEBUG] broot::shell_install::bash: considering path: "C:\\Users\\{real user}\\$ZDOTDIR/.zshrc/.zshrc"
00:55:56.462 [WARN] broot::shell_install::bash: no sourcing path for bash/zsh!
00:55:56.462 [DEBUG] broot::shell_install::fish: no fish config directory. Assuming fish isn't used.
00:55:56.462 [INFO] broot::shell_install::nushell: install nushell
00:55:56.462 [DEBUG] broot::shell_install::nushell: no nushell config directory. Assuming nushell isn't used.
00:55:56.462 [INFO] broot::shell_install::powershell: install powershell
00:55:56.462 [WARN] broot::shell_install::powershell: Could not find user documents directory.
00:55:56.462 [INFO] broot: bye

PS C:\Users\test use> [Environment]::GetFolderPath("MyDocuments")
C:\Users\test use\Documents

PS C:\Users\test use> $PSVersionTable
Name                           Value
----                           -----
PSVersion                      5.1.22621.2506
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.22621.2506
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Could you verify my result?

from broot.

lost22git avatar lost22git commented on June 14, 2024

https://github.com/Canop/broot/blob/996b34fb5cb2dfafe87269ee97b895b4e09bf937/src/shell_install/powershell.rs#L80C1-L80C1

Looks like a third-party library directories-rs issue

from broot.

lost22git avatar lost22git commented on June 14, 2024

broot.zip

I upgraded broot's directories-rs to the latest version. This is the new compiled product.
you can try it

from broot.

Canop avatar Canop commented on June 14, 2024

@lost22git I can't test on Windows. What you're saying is the problem should be fixed with the last version of directories-rs ?

from broot.

lost22git avatar lost22git commented on June 14, 2024

@Canop I'm not sure if directories-rs has fixed this problem

from broot.

Elkiwa avatar Elkiwa commented on June 14, 2024

broot.zip

I upgraded broot's directories-rs to the latest version. This is the new compiled product. you can try it

@lost22git Unfortunately, nothing changed in the debug log, but I can reason with you. I read some docs from directories-rs and the spec from Microsoft, but still can't tell where the issue could be.

image

image

from broot.

2gn avatar 2gn commented on June 14, 2024

I'm not sure if it's directly involved with this issue, but username with more than one space causes errors in installation.

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.