Skip to content

Commit

Permalink
feat: Add publish of @nushell/linux-riscv64 support
Browse files Browse the repository at this point in the history
  • Loading branch information
hustcer committed Mar 6, 2024
1 parent a240e36 commit 9326a7b
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 21 deletions.
13 changes: 7 additions & 6 deletions npm/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,14 @@
"typescript": "^5.2.2"
},
"optionalDependencies": {
"@nushell/windows-x64": "0.90.1",
"@nushell/windows-arm64": "0.90.1",
"@nushell/linux-x64": "0.90.1",
"@nushell/linux-arm64": "0.90.1",
"@nushell/linux-arm": "0.90.1",
"@nushell/darwin-arm64": "0.90.1",
"@nushell/darwin-x64": "0.90.1",
"@nushell/darwin-arm64": "0.90.1"
"@nushell/linux-arm": "0.90.1",
"@nushell/linux-arm64": "0.90.1",
"@nushell/linux-riscv64": "0.89.0",
"@nushell/linux-x64": "0.90.1",
"@nushell/windows-arm64": "0.90.1",
"@nushell/windows-x64": "0.90.1"
},
"eslintConfig": {
"extends": [
Expand Down
2 changes: 1 addition & 1 deletion nu/bump-ver.nu
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def main [
'@nushell/darwin-x64': 'x86_64-apple-darwin',
'@nushell/linux-arm': 'armv7-unknown-linux-gnueabihf',
'@nushell/linux-arm64': 'aarch64-unknown-linux-gnu',
# '@nushell/linux-riscv64': 'riscv64gc-unknown-linux-gnu',
'@nushell/linux-riscv64': 'riscv64gc-unknown-linux-gnu',
'@nushell/linux-x64': 'x86_64-unknown-linux-musl',
'@nushell/windows-arm64': 'aarch64-pc-windows-msvc',
'@nushell/windows-x64': 'x86_64-pc-windows-msvc',
Expand Down
25 changes: 13 additions & 12 deletions nu/common.nu
Original file line number Diff line number Diff line change
Expand Up @@ -27,34 +27,35 @@ export def 'is-installed' [ app: string ] {
(which $app | length) > 0
}

# Compare two version number, return `true` if first one is higher than second one,
# Return `null` if they are equal, otherwise return `false`
export def 'compare-ver' [
# Compare two version number, return `1` if first one is higher than second one,
# Return `0` if they are equal, otherwise return `-1`
export def compare-ver [
from: string,
to: string,
] {
let dest = ($to | str downcase | str trim -c 'v' | str trim)
let source = ($from | str downcase | str trim -c 'v' | str trim)
let v1 = ($source | split row '.' | each {|it| ($it | into int)})
let v2 = ($dest | split row '.' | each {|it| ($it | into int)})
# Ignore '-beta' or '-rc' suffix
let v1 = ($source | split row '.' | each {|it| ($it | parse -r '(?P<v>\d+)' | get v | get 0 )})
let v2 = ($dest | split row '.' | each {|it| ($it | parse -r '(?P<v>\d+)' | get v | get 0 )})
for $v in $v1 -n {
let c1 = ($v1 | get -i $v.index | default 0)
let c2 = ($v2 | get -i $v.index | default 0)
let c1 = ($v1 | get -i $v.index | default 0 | into int)
let c2 = ($v2 | get -i $v.index | default 0 | into int)
if $c1 > $c2 {
return true
return 1
} else if ($c1 < $c2) {
return false
return (-1)
}
}
return null
return 0
}

# Compare two version number, return true if first one is lower then second one
export def 'is-lower-ver' [
export def is-lower-ver [
from: string,
to: string,
] {
(compare-ver $from $to) == false
(compare-ver $from $to) < 0
}

# Check if git was installed and if current directory is a git repo
Expand Down
2 changes: 1 addition & 1 deletion nu/npm.nu
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ let pkgs = [
'aarch64-apple-darwin'
'aarch64-unknown-linux-gnu'
'armv7-unknown-linux-gnueabihf'
# 'riscv64gc-unknown-linux-gnu'
'riscv64gc-unknown-linux-gnu'
'x86_64-apple-darwin'
'x86_64-pc-windows-msvc'
'aarch64-pc-windows-msvc'
Expand Down
2 changes: 1 addition & 1 deletion nu/typos.nu
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

def main [output: string] {

if not (which typos | length) > 0 {
if not ((which typos | length) > 0) {
print $'(ansi y)[WARN]: (ansi reset)`Typos` not installed, please install it by running `brew install typos-cli`...'
exit 2
}
Expand Down

0 comments on commit 9326a7b

Please sign in to comment.