Skip to content

Commit

Permalink
sanitize the paths for the Windows CI
Browse files Browse the repository at this point in the history
  • Loading branch information
amtoine committed Nov 7, 2023
1 parent 0f3a397 commit 02861d6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
2 changes: 2 additions & 0 deletions src/nu-git-manager/fs/dir.nu
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use path.nu ["path sanitize"]

# clean all empty directories recursively, starting from a list of empty leaves
#
# /!\ this command will return sanitized paths /!\
Expand Down
15 changes: 9 additions & 6 deletions tests/gm.nu
Original file line number Diff line number Diff line change
Expand Up @@ -246,17 +246,20 @@ export def store-cleaning-after-remove [] {
export def store-cleaning [] {
run-with-env --prepare-cache {
gm clone https://github.com/amtoine/nu-git-manager --depth 1
rm --force --recursive --verbose (
$env.GIT_REPOS_HOME | path join "github.com/amtoine/nu-git-manager"

let repo = (
$env.GIT_REPOS_HOME | path join "github.com/amtoine/nu-git-manager" | path sanitize
)

let expected = [($env.GIT_REPOS_HOME | path join "github.com/amtoine")]
rm --force --recursive --verbose $repo

let expected = [($repo | path dirname)]
assert equal (gm clean --list) $expected

let expected = [
($env.GIT_REPOS_HOME | path join "github.com/amtoine")
($env.GIT_REPOS_HOME | path join "github.com")
$env.GIT_REPOS_HOME
($repo | path dirname)
($repo | path dirname --num-levels 2)
($repo | path dirname --num-levels 3)
]
assert equal (gm clean) $expected

Expand Down
2 changes: 1 addition & 1 deletion tests/mod.nu
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ export def store-cleaning [] {

let actual = $empty_directories
| each {|it|
let path = $env.GIT_REPOS_HOME | path join $it
let path = $env.GIT_REPOS_HOME | path join $it | path sanitize
mkdir $path

$path
Expand Down

0 comments on commit 02861d6

Please sign in to comment.