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
49 changes: 39 additions & 10 deletions fish/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@ if command -v fish > /dev/null; then
fi
fi

if [ "Darwin" != "$(uname -s)" ]; then
echo "No fish installer for Linux yet. Try this instead:"
echo " sudo apt install -y fish"
exit 1
fi

################
# Install fish #
Expand All @@ -35,8 +30,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 @@ -75,8 +100,12 @@ _macos_post_install() {
_macos_post_install

pkg_install() {
mv fish.app/Contents/Resources/base/usr/local "$HOME/.local/opt/fish-v${WEBI_VERSION}"

if [ "Darwin" = "$(uname -s)" ]; then
mv fish.app/Contents/Resources/base/usr/local "$pkg_src_dir"
else
mkdir -p "$pkg_src_dir/bin"
mv fish "$pkg_src_dir/bin/"
fi
}

pkg_post_install() {
Expand All @@ -85,7 +114,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 All @@ -96,8 +125,8 @@ pkg_post_install() {
# pkg_get_current_version is recommended, but (soon) not required
pkg_get_current_version() {
# 'fish --version' has output in this format:
# fish, version 3.1.2
# fish, version 4.3.3
# This trims it down to just the version number:
# 3.1.2
# 4.3.3
fish --version 2> /dev/null | head -n 1 | cut -d ' ' -f 3
}
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