-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e10797a
commit a8848a2
Showing
11 changed files
with
940 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,20 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
|
||
curl -s https://get.javanile.org/install | bash -s mush 0.1.1 | ||
## Install latest stable version | ||
curl -s https://get.javanile.org/install | bash -s mush 0.2.0 | ||
|
||
## Override with development branch | ||
if [ "$1" = "--branch" ] && [ -n "$2" ]; then | ||
git_uri=https://github.com/javanile/mush.git | ||
src_dir=$HOME/.mush/registry/src/https-github-com-javanile-mush/mush | ||
|
||
mush install console | ||
mkdir -p "${src_dir}" | ||
git clone --single-branch --branch "$2" "${git_uri}" "${src_dir}/$2" | ||
cd "${src_dir}/$2" | ||
mush build --release | ||
cp bin/mush ${HOME}/.mush/bin/mush | ||
${HOME}/.mush/bin/mush --version | ||
fi | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/usr/bin/env bash | ||
## BP010: Release metadata | ||
## @build_type: lib | ||
## @build_date: 2025-01-04T10:35:08Z | ||
set -e | ||
use() { return 0; } | ||
extern() { return 0; } | ||
legacy() { return 0; } | ||
module() { return 0; } | ||
public() { return 0; } | ||
embed() { return 0; } | ||
## BP004: Compile the entrypoint | ||
|
||
code_dumper() { | ||
local file | ||
local line | ||
local keyword | ||
local column | ||
local source | ||
local padding | ||
local keyword_padding | ||
local message | ||
local help | ||
|
||
file=$1 | ||
line=$2 | ||
keyword=$3 | ||
message=$4 | ||
help=$5 | ||
source=$(sed -n "${line}p" "${file}") | ||
column=${source%%$keyword*} | ||
padding=$(echo "$line" | sed 's/[0-9]/ /g') | ||
keyword_padding=$(echo "$column" | sed 's/./ /g') | ||
keyword_size=$(echo "$keyword" | sed 's/./^/g') | ||
|
||
echo -e "\e[0m${padding}\e[0m\e[0m\e[1m\e[38;5;12m--> \e[0m\e[0m${file}:${line}:${#column}\e[0m" | ||
echo -e "\e[0m${padding} \e[0m\e[0m\e[1m\e[38;5;12m|\e[0m" | ||
echo -e "\e[0m\e[1m\e[38;5;12m${line}\e[0m\e[0m \e[0m\e[0m\e[1m\e[38;5;12m|\e[0m\e[0m \e[0m\e[0m${source}\e[0m" | ||
echo -e "\e[0m${padding} \e[0m\e[0m\e[1m\e[38;5;12m| ${keyword_padding}\e[0m\e[0m\e[1m\e[38;5;9m${keyword_size}\e[0m\e[0m \e[0m\e[0m\e[1m\e[38;5;9m${message}\e[0m" | ||
if [ -n "${help}" ]; then | ||
echo -e "\e[0m${padding} \e[0m\e[0m\e[1m\e[38;5;12m|\e[0m" | ||
echo -e "\e[0m${padding} \e[0m\e[0m\e[1m\e[38;5;12m= \e[0m\e[1;39mhelp:\e[0m ${help}\e[0m" | ||
fi | ||
echo "" | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
#!/usr/bin/env bash | ||
## BP010: Release metadata | ||
## @build_type: lib | ||
## @build_date: 2025-01-04T10:52:11Z | ||
set -e | ||
use() { return 0; } | ||
extern() { return 0; } | ||
legacy() { return 0; } | ||
module() { return 0; } | ||
public() { return 0; } | ||
embed() { return 0; } | ||
## BP004: Compile the entrypoint | ||
|
||
# FATAL | ||
# ERROR | ||
# WARNING | ||
# INFO | ||
# DEBUG | ||
# TRACE | ||
# SUCCESS | ||
|
||
case "$(uname -s)" in | ||
Darwin*) | ||
ESCAPE='\x1B' | ||
;; | ||
Linux|*) | ||
ESCAPE='\e' | ||
;; | ||
esac | ||
|
||
#CONSOLE_INDENT="${ESCAPE}[1;33m{Mush}${ESCAPE}[0m" | ||
|
||
console_pad() { | ||
[ "$#" -gt 1 ] && [ -n "$2" ] && printf "%$2.${2#-}s" "$1" | ||
} | ||
|
||
console_log() { | ||
console_print "$1" "$2" | ||
} | ||
|
||
console_info() { | ||
if [ "${VERBOSE}" -gt "0" ]; then | ||
console_print "${ESCAPE}[1;36m$(console_pad "$1" 12)${ESCAPE}[0m" "$2" | ||
fi | ||
} | ||
|
||
console_warning() { | ||
console_print "${ESCAPE}[1;33m$(console_pad "$1" 12)${ESCAPE}[0m" "$2" | ||
} | ||
|
||
console_status() { | ||
console_print "${ESCAPE}[1;32m$(console_pad "$1" 12)${ESCAPE}[0m" "$2" | ||
} | ||
|
||
console_error() { | ||
echo -e "${ESCAPE}[1;31merror${ESCAPE}[0m: $1" >&2 | ||
} | ||
|
||
console_error_code() { | ||
echo -e "${ESCAPE}[1;31merror[$1]${ESCAPE}[1;39m: $2${ESCAPE}[0m" >&2 | ||
} | ||
|
||
console_hint() { | ||
echo -e "${ESCAPE}[1;39m$1${ESCAPE}[0m" >&2 | ||
} | ||
|
||
console_print() { | ||
if [ -z "${QUIET}" ]; then | ||
echo -e "$1 $2" >&2 | ||
fi | ||
} |
Oops, something went wrong.