Last active
December 23, 2022 09:02
-
-
Save dberstein/e0cd36edf54104b535491881b5a59bca to your computer and use it in GitHub Desktop.
CLI background launcher of IntelliJ using aliases for toolbox scripts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Locate tool whose basename matches ours in toolbox's scripts directory | |
# ie. ln -s [$HOME/.local/bin/]intellij.sh [$HOME/.local/bin/]clion | |
# ensure "$HOME/.local/bin" in PATH is *before* toolbox's path ($HOME/.local/share/JetBrains/Toolbox/scripts), | |
# that way invoking "clion" invokes intellij.sh and it invokes toolbox's in CLI's background. | |
declare TOOL="$( find "$HOME/.local/share/JetBrains/Toolbox/scripts" -mindepth 1 -maxdepth 1 -type f \ | |
-name "$(basename $0)" -executable -exec readlink -f {} \; )" | |
# No tool found is an error ... | |
if [ -z "$TOOL" ]; then | |
echo "Error, not an executable file:" $(basename $0) | |
exit 1 | |
fi | |
# Background launch tool ... | |
$TOOL $@ &>/dev/null & |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment