Skip to content

Commit a861e53

Browse files
committed
🏁 update Justfile
1 parent e7d2885 commit a861e53

File tree

2 files changed

+18
-13
lines changed

2 files changed

+18
-13
lines changed

.github/workflows/check.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ jobs:
5353
run: sass -s compressed --random-seed 0 style/snow.scss style/snow.css
5454
- name: Build JS & CSS
5555
run: just clean && just build
56+
- name: Format Justfile
57+
run: just --fmt --unstable
5658
- name: Generate humans.txt
5759
run: ./scripts/humans.py
5860
- name: Sort methods

Justfile

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,43 @@
1+
default:
2+
@just --list --justfile "{{ justfile() }}"
3+
14
do-it:
25
@xdg-open https://youtu.be/AkygX8Fncpk
36

47
build:
5-
@just build_js 2> /dev/null ||:
8+
-@just build_js 2> /dev/null
69
just build_css
710
just build_js
811

9-
build_css *args: ( esbuild '--outbase=style' '--outdir=an_website/static/css' '"style/**/*.css"' args )
12+
build_css *args: (esbuild '--outbase=style' '--outdir=an_website/static/css' '"style/**/*.css"' args)
1013

11-
build_js_debug *args: ( esbuild 'an_website/**/*[!_].ts' '--bundle' '"--external:/static/*"' '--legal-comments=inline' '"--footer:js=// @license-end"' '--format=esm' '--outbase=an_website' '--outdir=an_website/static/js' '"--alias:@utils/utils.js=$(./scripts/fix_static_url_path.py /static/js/utils/utils.js)"' args )
14+
build_js_debug *args: (esbuild 'an_website/**/*[!_].ts' '--bundle' '"--external:/static/*"' '--legal-comments=inline' '"--footer:js=// @license-end"' '--format=esm' '--outbase=an_website' '--outdir=an_website/static/js' '"--alias:@utils/utils.js=$(./scripts/fix_static_url_path.py /static/js/utils/utils.js)"' args)
1215

13-
build_js *args: ( build_js_debug '--pure:console.log' '--pure:console.debug' args )
16+
build_js *args: (build_js_debug '--pure:console.log' '--pure:console.debug' args)
1417

1518
clean: clean_css clean_js
1619
./scripts/compress_static_files.py --clean
1720

1821
clean_css:
19-
rm -fr an_website/static/css
22+
rm -fr "{{ justfile_directory() }}/an_website/static/css"
2023

2124
clean_js:
22-
rm -fr an_website/static/js
25+
rm -fr "{{ justfile_directory() }}/an_website/static/js"
2326

2427
esbuild *args:
25-
deno run -A https://deno.land/x/esbuild@v0.24.2/mod.js --target=$(just target),chrome103,edge129,firefox115,ios11,opera114,safari15.6 --charset=utf8 --minify --sourcemap --tree-shaking=false {{args}}
28+
deno run -A https://deno.land/x/esbuild@v0.24.2/mod.js --target=$(just target),chrome103,edge129,firefox115,ios11,opera114,safari15.6 --charset=utf8 --minify --sourcemap --tree-shaking=false {{ args }}
2629

2730
target:
2831
#!/usr/bin/env python3
29-
from datetime import datetime, timezone
30-
print(end="es")
31-
print(min((now := datetime.now(timezone.utc)).year - (5 + (now.month < 7)), 2022))
32+
year = {{ datetime_utc('%Y') }}
33+
month = {{ trim_start_match(datetime_utc('%m'), '0') }}
34+
print(f"es{min(year - (5 + (month < 7)), 2022)}")
3235

33-
watch_css: ( build_css '--watch' )
36+
watch_css: (build_css '--watch')
3437

35-
watch_js: ( build_js '--watch' )
38+
watch_js: (build_js '--watch')
3639

37-
watch_js_debug: ( build_js_debug '--watch' )
40+
watch_js_debug: (build_js_debug '--watch')
3841

3942
watman:
4043
@deno eval 'console.log(Array(16).join("wat" - 1) + " Batman!")'

0 commit comments

Comments
 (0)