-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Update mosdepth recipe #48070
base: master
Are you sure you want to change the base?
Update mosdepth recipe #48070
Changes from 13 commits
cde674d
663bc7d
b68b048
98fed21
bee617b
4286307
6125f2d
baffd71
908eaaa
ed5845f
854781a
80347d9
2734818
18ae6cb
cb2dbb7
69a9e3c
90e48a0
d1289e8
ed033d1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -1,20 +1,24 @@ | ||||||||||||||||||||||||||
#!/bin/sh | ||||||||||||||||||||||||||
#!/bin/bash | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
if [[ ${target_platform} == osx-64 ]] ; then | ||||||||||||||||||||||||||
curl -SL https://github.com/nim-lang/nightlies/releases/download/latest-version-1-6/macosx_x64.tar.xz -o macosx_x64.tar.xz | ||||||||||||||||||||||||||
if [[ ${target_platform} == "osx-64" ]] ; then | ||||||||||||||||||||||||||
curl -SL https://github.com/nim-lang/nightlies/releases/download/latest-version-2-2/macosx_x64.tar.xz -o macosx_x64.tar.xz | ||||||||||||||||||||||||||
tar -xzf macosx_x64.tar.xz | ||||||||||||||||||||||||||
cd nim-1.6.* | ||||||||||||||||||||||||||
cd nim-2.2.* | ||||||||||||||||||||||||||
export PATH="$PWD/bin:$PATH" | ||||||||||||||||||||||||||
cd .. | ||||||||||||||||||||||||||
curl -SL https://github.com/brentp/mosdepth/archive/refs/tags/v${PKG_VERSION}.tar.gz -o mosdepth-latest.tar.gz | ||||||||||||||||||||||||||
tar -xzf mosdepth-latest.tar.gz | ||||||||||||||||||||||||||
cd mosdepth-${PKG_VERSION} | ||||||||||||||||||||||||||
nimble install -y "docopt@0.7.0" | ||||||||||||||||||||||||||
martin-g marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add error handling for directory changes. The - cd nim-2.2.*
+ cd nim-2.2.* || exit 1
export PATH="$PWD/bin:$PATH"
- cd ..
+ cd .. || exit 1
curl -SL https://github.com/brentp/mosdepth/archive/refs/tags/v${PKG_VERSION}.tar.gz -o mosdepth-latest.tar.gz
tar -xzf mosdepth-latest.tar.gz
- cd mosdepth-${PKG_VERSION}
+ cd mosdepth-${PKG_VERSION} || exit 1 📝 Committable suggestion
Suggested change
🧰 Tools🪛 Shellcheck
|
||||||||||||||||||||||||||
nimble build -y --verbose -d:release | ||||||||||||||||||||||||||
export CFLAGS="$CFLAGS -I$PREFIX/include" | ||||||||||||||||||||||||||
export LDFLAGS="$LDFLAGS -L$PREFIX/lib" | ||||||||||||||||||||||||||
nimble install -y "docopt@0.7.1" --passC:"-I$PREFIX/include" --passL:"-L$PREFIX/lib" | ||||||||||||||||||||||||||
nimble build -y --verbose -d:release -d:d4 --passC:"-I$PREFIX/include" --passL:"-L$PREFIX/lib" | ||||||||||||||||||||||||||
else | ||||||||||||||||||||||||||
curl -SL https://github.com/brentp/mosdepth/releases/download/v$PKG_VERSION/mosdepth -o mosdepth | ||||||||||||||||||||||||||
#Link to mosdepth_d4 is specified below because of https://github.com/brentp/mosdepth/issues/232 | ||||||||||||||||||||||||||
curl -SL https://github.com/brentp/mosdepth/releases/download/v$PKG_VERSION/mosdepth_d4 -o mosdepth | ||||||||||||||||||||||||||
chmod +x mosdepth | ||||||||||||||||||||||||||
fi | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
mkdir -p "${PREFIX}/bin" | ||||||||||||||||||||||||||
cp mosdepth "${PREFIX}/bin/" | ||||||||||||||||||||||||||
chmod 0755 mosdepth | ||||||||||||||||||||||||||
mv mosdepth "${PREFIX}/bin/" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Add error handling for directory changes
Directory changes should handle potential failures.
Also applies to: 8-8, 16-16
🧰 Tools
🪛 Shellcheck
[warning] 6-6: Use 'cd ... || exit' or 'cd ... || return' in case cd fails.
(SC2164)