add shellcheck

pull/106/head
Muhammad Atif Ali 2 years ago
parent 0064ce3fea
commit 48e13432fc

@ -35,4 +35,4 @@ jobs:
- name: Format - name: Format
run: bun fmt:ci run: bun fmt:ci
- name: Lint - name: Lint
run: bun install && bun lint run: bun lint

@ -1,4 +1,7 @@
#!/usr/bin/env bash #!/usr/bin/env sh
# Convert templated variables to shell variables
LOG_PATH=${LOG_PATH}
BOLD='\033[0;1m' BOLD='\033[0;1m'
printf "$${BOLD}Installing MODULE_NAME ...\n\n" printf "$${BOLD}Installing MODULE_NAME ...\n\n"
@ -13,6 +16,6 @@ printf "👷 Starting MODULE_NAME in background...\n\n"
# 1. Use & to run it in background # 1. Use & to run it in background
# 2. redirct stdout and stderr to log files # 2. redirct stdout and stderr to log files
./app >${LOG_PATH} 2>&1 & ./app > "$${LOG_PATH}" 2>&1 &
printf "check logs at ${LOG_PATH} \n\n" printf "check logs at %s\n\n" "$${LOG_PATH}"

Binary file not shown.

@ -23,7 +23,7 @@ mkdir -p "${MODULE_NAME}"
cp -r .sample/* "${MODULE_NAME}" cp -r .sample/* "${MODULE_NAME}"
# Change to module directory # Change to module directory
cd "${MODULE_NAME}" cd "${MODULE_NAME}" || echo "Failed to change directory to ${MODULE_NAME}" && exit 1
# Detect OS # Detect OS
if [[ "$OSTYPE" == "darwin"* ]]; then if [[ "$OSTYPE" == "darwin"* ]]; then

@ -2,15 +2,16 @@
"name": "modules", "name": "modules",
"scripts": { "scripts": {
"test": "bun test", "test": "bun test",
"fmt": "bun x prettier --plugin prettier-plugin-sh -w **/*.sh **/*.ts **/*.md *.md && terraform fmt **/*.tf", "fmt": "bun x prettier --plugin prettier-plugin-sh -w **/*.sh .sample/run.sh new.sh **/*.ts **/*.md *.md && terraform fmt **/*.tf .sample/main.tf",
"fmt:ci": "bun x prettier --plugin prettier-plugin-sh --check **/*.sh **/*.ts **/*.md *.md && terraform fmt -check **/*.tf", "fmt:ci": "bun x prettier --plugin prettier-plugin-sh --check **/*.sh .sample/run.sh new.sh **/*.ts **/*.md *.md && terraform fmt -check **/*.tf .sample/main.tf",
"lint": "bun run lint.ts" "lint": "bun run lint.ts && bun x shellcheck **/*.sh .sample/run.sh new.sh"
}, },
"devDependencies": { "devDependencies": {
"bun-types": "^1.0.3", "bun-types": "^1.0.3",
"gray-matter": "^4.0.3", "gray-matter": "^4.0.3",
"marked": "^9.0.3", "marked": "^9.0.3",
"prettier-plugin-sh": "^0.13.1" "prettier-plugin-sh": "^0.13.1",
"shellcheck": "^2.2.0"
}, },
"peerDependencies": { "peerDependencies": {
"typescript": "^5.0.0" "typescript": "^5.0.0"

Loading…
Cancel
Save