Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions _webi/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,14 @@ Builds.getPackage({ name: projName }).then(async function (/*projInfo*/) {
var nodeOs = os.platform();
var nodeOsRelease = os.release();
var nodeArch = os.arch();

// To make arch names compatible across all helpers
if (nodeArch === 'x64') {
nodeArch = 'amd64';
} else if (nodeArch === 'arm64') {
nodeArch = 'arm64';
}

var nodeLibc = 'libc';
if (process.platform === 'linux') {
nodeLibc = 'gnu';
Expand Down
32 changes: 31 additions & 1 deletion fish/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,38 @@ pkg_src_dir="$HOME/.local/opt/fish-v$WEBI_VERSION"
pkg_src="$pkg_src_cmd"

# pkg_install must be defined by every package
_linux_post_install() {
if [ "Linux" != "$(uname -s)" ]; then #terminate if MacOS
return 0
fi

if ! [ -e "$HOME/.local/bin/fish" ]; then
return 0
fi

echo ""
echo "To set fish as your default shell, run:"
echo ""

# Check if fish is in /etc/shells
if grep -q "$HOME/.local/bin/fish" /etc/shells 2> /dev/null; then
echo " chsh -s $HOME/.local/bin/fish"
else
echo " # First, add fish to allowed shells"
echo " echo '$HOME/.local/bin/fish' | sudo tee -a /etc/shells"
echo ""
echo " # Then change your default shell:"
echo " chsh -s $HOME/.local/bin/fish"
fi
echo ""
}

_macos_post_install() {

if [ "Darwin" != "$(uname -s)" ]; then #terminate if linux machine
return 0
fi

if ! [ -e "$HOME/.local/bin/fish" ]; then
return 0
fi
Expand Down Expand Up @@ -85,7 +115,7 @@ pkg_post_install() {

# try again to update default shells, now that all files should exist
_macos_post_install

_linux_post_install
if [ ! -e ~/.config/fish/config.fish ]; then
mkdir -p ~/.config/fish
touch ~/.config/fish/config.fish
Expand Down
17 changes: 17 additions & 0 deletions fish/releases.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,23 @@ module.exports = function () {
rel.arch = 'amd64';
return rel;
}

// Linux x86_64 binary
// e.g. fish-4.3.2-linux-x86_64.tar.xz
if (/-linux-x86_64\.tar\.xz$/.test(rel.name)) {
rel.os = 'linux';
rel.arch = 'amd64';
return rel;
}

// Linux aarch64 binary
// e.g. fish-4.3.2-linux-aarch64.tar.xz
if (/-linux-aarch64\.tar\.xz$/.test(rel.name)) {
rel.os = 'linux';
rel.arch = 'arm64';
return rel;
}

})
.filter(Boolean);
return all;
Expand Down