mirror of
https://github.com/unraid/api.git
synced 2026-01-06 08:39:54 -06:00
chore: improve dx for scripting & setup (#969)
* chore: rm vs code visual customizations * chore(api): fix vscode eslint extension * chore(web): update env.example for local development * chore: add justfiles to simplify workflows * chore: stub monorepo readme * chore: add nvmrc to monorepo root * refactor: improve error handling in `just ignore` * doc(web): explain TAILWIND_BASE_FONT_SIZE in .env.example * chore: add logo to readme
This commit is contained in:
42
justfile
Normal file
42
justfile
Normal file
@@ -0,0 +1,42 @@
|
||||
# The first recipe in a justfile is considered the default recipe,
|
||||
# which means it runs when `just` is called with no arguments
|
||||
|
||||
default: list-commands
|
||||
|
||||
list-commands:
|
||||
@just --list --justfile {{justfile()}} --list-heading $'\nMonorepo recipes:\n'
|
||||
|
||||
# Prepares the repo for development
|
||||
setup:
|
||||
# ignore personal vscode settings. to contribute a change, use `just stop-ignore $file`
|
||||
@just ignore .vscode/settings.json api/.vscode/settings.json web/.vscode/settings.json
|
||||
# ignore api local-state files
|
||||
@just ignore api/dev/states/myservers.cfg api/dev/Unraid.net/myservers.cfg
|
||||
|
||||
just api/setup
|
||||
just web/setup
|
||||
|
||||
|
||||
# starts ignoring a file already tracked by git. (gitignore will not apply to these files)
|
||||
[group('git')]
|
||||
[no-cd]
|
||||
ignore +files:
|
||||
#!/usr/bin/env bash
|
||||
for file in {{ files }}; do
|
||||
if [ ! -f "$file" ]; then
|
||||
echo "Warning: $file does not exist"
|
||||
continue
|
||||
fi
|
||||
git update-index --skip-worktree "$file"
|
||||
done
|
||||
|
||||
# resumes normal tracking of an ignored tracked file.
|
||||
[group('git')]
|
||||
[no-cd]
|
||||
stop-ignoring file:
|
||||
git update-index --no-skip-worktree {{ file }}
|
||||
|
||||
# lists tracked files where further changes are being ignored.
|
||||
[group('git')]
|
||||
list-ignored:
|
||||
-git ls-files -v | grep '^S'
|
||||
Reference in New Issue
Block a user