Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add makefile to setup links in a new repo #3

Merged
merged 1 commit into from
Oct 22, 2024
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
30 changes: 30 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@

setup-workflows-dir:
@if [ ! -d "../.github/workflows" ]; then mkdir -p ../.github/workflows; fi

configure-commit-lint: setup-workflows-dir
@if [ -f "../.github/workflows/commit-lint.yaml" ]; then echo "ERROR: .github/workflows/commit-lint.yaml already exists"; exit 1; fi
@if [ -f "../commitlint.config.js" ]; then echo "ERROR: commitlint.config.js already exists"; exit 1; fi
ln .github/workflows/commit-lint.yaml ../.github/workflows/commit-lint.yaml
ln commitlint.config.js ../commitlint.config.js
@echo "Commit linting configured to use Swiss Army Knife!"

configure-label-lint: setup-workflows-dir
@if [ -f "../.github/workflows/label-lint.yaml" ]; then echo "ERROR: .github/workflows/label-lint.yaml already exists"; exit 1; fi
ln .github/workflows/label-lint.yaml ../.github/workflows/label-lint.yaml
@echo "Label linting configured to use Swiss Army Knife!"

remove-commit-lint:
@if [ -f "../.github/workflows/commit-lint.yaml" ]; then rm ../.github/workflows/commit-lint.yaml; fi
@if [ -f "../commitlint.config.js" ]; then rm ../commitlint.config.js; fi
@echo "Commit linting removed!"

remove-label-lint:
@if [ -f "../.github/workflows/label-lint.yaml" ]; then rm ../.github/workflows/label-lint.yaml; fi
@echo "Label linting removed!"

remove-all: remove-commit-lint remove-label-lint
@echo "All configurations have been removed!"

configure-all: configure-commit-lint configure-label-lint
@echo "All configurations have been set up to use Swiss Army Knife!"
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,17 @@ This repository serves as a personal toolkit, housing various templates, code sn

## Usage

Feel free to explore the repository and use any code or information that you find helpful. Each directory contains its own README with specific details about its contents and how to use them.
Feel free to explore the repository and use any code or information that you find helpful.

The repository is designed to be used as a submodule from the base of your repo.

```bash
git submodule add [email protected]:gphorvath/swiss-army-knife.git

cd swiss-army-knife

make <choose a setup command>
```

## Contributing

Expand All @@ -28,4 +38,4 @@ If you have any questions or would like to discuss anything in this repository,

---

Happy coding!
Happy coding!
Loading