-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemplate.bat
52 lines (45 loc) · 1.3 KB
/
template.bat
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
@echo off
set param=%1
IF %param%=="c" (
wget https://raw.githubusercontent.com/SolonRubens/templates/main/src/template.c
)
IF %param%=="cpp" (
wget https://raw.githubusercontent.com/SolonRubens/templates/main/src/template.cpp
)
IF %param%=="py" (
wget https://raw.githubusercontent.com/SolonRubens/templates/main/src/template.py
)
IF %param%=="node_express" (
git clone --branch main --no-checkout https://github.com/SolonRubens/templates.git
cd templates
git sparse-checkout set node_express
git checkout main
cd ..
Xcopy /E /I .\templates\src\node_express .\node_express
rmdir .\templates
cd node_express
npm init
npm i express
)
IF %param%=="vue3" (
npm init vue@latest
for /F "eol=| delims=" %%I in ('dir * /AD /B /O-D 2^>nul') do cd "%%I" & goto DoneCD
echo No subdirectory found in : "%CD%"
:DoneCD
npm install
npm run dev
)
IF %param%=="-h" (
echo "---------------------------------------------------------"
echo "TEMPLATE - Template generator (C) 2023 by Jonathan Silber"
echo "---------------------------------------------------------"
echo ""
echo "Usage: template [format]"
echo ""
echo "Supported format values:"
echo " c"
echo " cpp"
echo " py"
echo " node_express"
echo " vue3"
)