Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ jobs:
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 #v5.6.0
with:
python-version: "3.x"
- name: Install shfmt and shellcheck
if: steps.apt-cache.outputs.cache-hit != 'true'
run: sudo apt-get update && sudo apt-get install -y shellcheck shfmt
- name: Install dependencies
run: |
chmod +x shell/install_shell_deps.sh
./shell/install_shell_deps.sh
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd #v3.0.1
with:
extra_args: --all-files
4 changes: 2 additions & 2 deletions .github/workflows/versioning.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
with:
fetch-depth: 0

- name: Release
uses: cycjimmy/semantic-release-action@v4
uses: cycjimmy/semantic-release-action@16ca923e6ccbb50770c415a0ccd43709a8c5f7a4 #v4.2.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6 changes: 6 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"semi": false,
"tabWidth": 4,
"trailingComma": "es5",
"printWidth": 105
}
12 changes: 6 additions & 6 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"branches": ["main"],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/github"
]
"branches": ["main"],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/github"
]
}
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,17 @@ setup_dev:
pipx install pre-commit
pre-commit install

brew install shfmt shellcheck
chmod +x shell/install_shell_deps.sh
./shell/install_shell_deps.sh

assert_setup_dev:
pre-commit run -a

ci:
chmod +x common/install_brew_packages.sh
./common/install_brew_packages.sh

lint:
find . -type f -name "*.sh" -exec shfmt -w -i 6 {} +
find . -type f -name "*.sh" -exec shellcheck {} +
prettier --write "**/*.{json,yaml,yml,md}"
21 changes: 17 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Shared Scripts

Collection of development setup and utility scripts for macOS environments.
Quick-share command line scripts for use in quick command runner like Makefile or Justfile.

## Quick Start

Expand All @@ -11,6 +11,19 @@ make assert_setup_dev # Validate setup

## Requirements

- macOS
- Homebrew
- Zsh shell
- macOS
- Homebrew
- Zsh shell

## Usage

```bash
git submodule add -b main https://github.com/wisarootl/shared-scripts.git scripts/shared
```

```Makefile
setup_dev:
chmod +x scripts/shared/node/setup_dev.sh
./scripts/shared/node/setup_dev.sh
exec zsh
```
11 changes: 11 additions & 0 deletions shell/install_shell_deps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash

set -e

if [[ "$OSTYPE" == "darwin"* ]]; then
brew install shfmt shellcheck prettier
else
sudo apt-get update
sudo apt-get install -y shfmt shellcheck nodejs npm
npm install -g prettier
fi