-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
49 lines (35 loc) · 1015 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
BOM_PATH?=_data/bill_of_materials.csv
XML_PATH?=hardware/*.xml
.PHONY: default serve build install bom
default: serve
serve:
bundle exec jekyll serve
build:
jekyll build
bom:
rm -f $(BOM_PATH)
python scripts/bom.py $(XML_PATH) $(BOM_PATH)
stats:
python3 scripts/bom_stats.py $(BOM_PATH)
install:
echo "Installing git-secrets from awslabs..."
brew install git-secrets
echo "Adding git-secrets config..."
cat scripts/_git-secrets >> .git/config
echo "Installing git hook"
touch .git/hooks/pre-commit || exit
echo "Making pre-commit hook executable"
chmod u+x .git/hooks/pre-commit
echo "Adding .gitignore..."
cat scripts/_gitignore > .gitignore
echo "Adding Gemfile and installing ruby gems..."
cat scripts/Gemfile > Gemfile
bundle install
update:
git submodule foreach --recursive git reset --hard HEAD
git submodule update --remote
uncommit:
# git uncommit the last commit
git reset --hard HEAD~1
# remove the last commit in main branch from the GitHub
git push -f origin main