generated from filipe1309/shubcogen-template
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathMakefile
66 lines (54 loc) · 2.07 KB
/
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
.ONESHELL:
SHELL := /bin/bash
GRAY_DARKER=\033[0;90m
BOLD=\033[1m
ITALIC=\033[3m
NC=\033[0m # No Color
# install dependencies
install:
@echo "📦 Installing dependencies..."
npm install
npm run prepare
# run all tests: make test
# run specific test: make test t=two-number-sumtest
test:
@echo "🟢 Running tests..."
npm run test -- -t "${t}"
# run changed tests: make test-changed
test-changed:
@echo "🟢 Running changed tests..."
npm run test:changed
# run node
run:
@echo "🏁 Running code..."
make test
# create new challenge
# example: make new [c=valid-subsequence] [l=easy] [ct=arrays]
# example 2: make new [c="Invert Binary Tree"] [l=medium] [ct="Binary Trees"]
new:
./scripts/new.sh name="${c}" level="${l}" category="${ct}"
# create new solution
# example: make new-solution [c=valid-subsequence] [l=easy]
new-solution:
./scripts/new-solution.sh name="${c}" level="${l}"
# commit changes
# example: make commit [m="feat: add two number sum solution"]
commit:
./scripts/commit.sh m="${m}"
help:
@echo -e "📖 ${BOLD}Available commands:${NC}"
@echo ""
@echo -e " make ${BOLD}install${NC} ${GRAY_DARKER}(installs dependencies)${NC}"
@echo -e " make ${BOLD}test${NC} ${ITALIC}[t=<challenge-name-in-snake-case>]${NC} ${GRAY_DARKER}(runs all tests or specific test)${NC}"
@echo -e " make ${BOLD}test-changed${NC} ${GRAY_DARKER}(runs changed tests)${NC}"
@echo -e " make ${BOLD}new${NC} ${ITALIC}[c=<challenge-name-in-snake-case>] [l=<level>] [ct=<category>]${NC} ${GRAY_DARKER}(creates new challenge, levels: (easy, medium, hard, very-hard))${NC}"
@echo -e " make ${BOLD}new-solution${NC} ${ITALIC}[c=<challenge-name-in-snake-case>] [l=<level>]${NC} ${GRAY_DARKER}(creates new solution, levels: (easy, medium, hard, very-hard))${NC}"
@echo -e " make ${BOLD}commit${NC} ${GRAY_DARKER}(commits changes and updates README.md)${NC}"
@echo -e " make ${BOLD}help${NC}"
# run:
# @$(eval ARG := $(filter-out $@,$(MAKECMDGOALS)))
# @echo Running with argument: $(ARG)
# mkdir src/${ARG}
# # @echo Running with argument: $(filter-out $@,$(MAKECMDGOALS))
# %:
# @echo ""