Skip to content

Commit 38f9447

Browse files
New release!
1 parent d1585e8 commit 38f9447

File tree

4 files changed

+144
-2
lines changed

4 files changed

+144
-2
lines changed

.github/workflows/project@francescobianco@matrix-theme.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
- main
77

88
env:
9-
HACKATHON_PACKAGE_NAME: hackathon
9+
HACKATHON_PACKAGE_NAME: console
1010

1111
jobs:
1212
install-mush:

.github/workflows/template.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
- main
77

88
env:
9-
HACKATHON_PACKAGE_NAME: hackathon
9+
HACKATHON_PACKAGE_NAME: console
1010

1111
jobs:
1212
install-mush:

lib/console

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
#!/usr/bin/env bash
2+
## BP010: Release metadata
3+
## @build_type: lib
4+
## @build_date: 2025-03-28T14:09:22Z
5+
set -e
6+
use() { return 0; }
7+
extern() { return 0; }
8+
legacy() { return 0; }
9+
module() { return 0; }
10+
public() { return 0; }
11+
embed() { return 0; }
12+
## BP004: Compile the entrypoint
13+
14+
# FATAL
15+
# ERROR
16+
# WARNING
17+
# INFO
18+
# DEBUG
19+
# TRACE
20+
# SUCCESS
21+
22+
case "$(uname -s)" in
23+
Darwin*)
24+
ESCAPE='\x1B'
25+
;;
26+
Linux|*)
27+
ESCAPE='\e'
28+
;;
29+
esac
30+
31+
#CONSOLE_INDENT="${ESCAPE}[1;33m{Mush}${ESCAPE}[0m"
32+
33+
console_pad() {
34+
[ "$#" -gt 1 ] && [ -n "$2" ] && printf "%$2.${2#-}s" "$1"
35+
}
36+
37+
console_log() {
38+
console_print "$1" "$2"
39+
}
40+
41+
console_info() {
42+
if [ "${VERBOSE}" -gt "0" ]; then
43+
console_print "${ESCAPE}[1;36m$(console_pad "$1" 12)${ESCAPE}[0m" "$2"
44+
fi
45+
}
46+
47+
console_warning() {
48+
console_print "${ESCAPE}[1;33m$(console_pad "$1" 12)${ESCAPE}[0m" "$2"
49+
}
50+
51+
console_status() {
52+
console_print "${ESCAPE}[1;32m$(console_pad "$1" 12)${ESCAPE}[0m" "$2"
53+
}
54+
55+
console_error() {
56+
echo -e "${ESCAPE}[1;31merror${ESCAPE}[0m: $1" >&2
57+
}
58+
59+
console_error_code() {
60+
echo -e "${ESCAPE}[1;31merror[$1]${ESCAPE}[1;39m: $2${ESCAPE}[0m" >&2
61+
}
62+
63+
console_hint() {
64+
echo -e "${ESCAPE}[1;39m$1${ESCAPE}[0m" >&2
65+
}
66+
67+
console_print() {
68+
if [ -z "${QUIET}" ]; then
69+
echo -e "$1 $2" >&2
70+
fi
71+
}

packages/console/lib.sh

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
#!/usr/bin/env bash
2+
## BP010: Release metadata
3+
## @build_type: lib
4+
## @build_date: 2025-03-28T14:09:22Z
5+
set -e
6+
use() { return 0; }
7+
extern() { return 0; }
8+
legacy() { return 0; }
9+
module() { return 0; }
10+
public() { return 0; }
11+
embed() { return 0; }
12+
## BP004: Compile the entrypoint
13+
14+
# FATAL
15+
# ERROR
16+
# WARNING
17+
# INFO
18+
# DEBUG
19+
# TRACE
20+
# SUCCESS
21+
22+
case "$(uname -s)" in
23+
Darwin*)
24+
ESCAPE='\x1B'
25+
;;
26+
Linux|*)
27+
ESCAPE='\e'
28+
;;
29+
esac
30+
31+
#CONSOLE_INDENT="${ESCAPE}[1;33m{Mush}${ESCAPE}[0m"
32+
33+
console_pad() {
34+
[ "$#" -gt 1 ] && [ -n "$2" ] && printf "%$2.${2#-}s" "$1"
35+
}
36+
37+
console_log() {
38+
console_print "$1" "$2"
39+
}
40+
41+
console_info() {
42+
if [ "${VERBOSE}" -gt "0" ]; then
43+
console_print "${ESCAPE}[1;36m$(console_pad "$1" 12)${ESCAPE}[0m" "$2"
44+
fi
45+
}
46+
47+
console_warning() {
48+
console_print "${ESCAPE}[1;33m$(console_pad "$1" 12)${ESCAPE}[0m" "$2"
49+
}
50+
51+
console_status() {
52+
console_print "${ESCAPE}[1;32m$(console_pad "$1" 12)${ESCAPE}[0m" "$2"
53+
}
54+
55+
console_error() {
56+
echo -e "${ESCAPE}[1;31merror${ESCAPE}[0m: $1" >&2
57+
}
58+
59+
console_error_code() {
60+
echo -e "${ESCAPE}[1;31merror[$1]${ESCAPE}[1;39m: $2${ESCAPE}[0m" >&2
61+
}
62+
63+
console_hint() {
64+
echo -e "${ESCAPE}[1;39m$1${ESCAPE}[0m" >&2
65+
}
66+
67+
console_print() {
68+
if [ -z "${QUIET}" ]; then
69+
echo -e "$1 $2" >&2
70+
fi
71+
}

0 commit comments

Comments
 (0)