~aprates/gempress

gempress/new-capsule -rwxr-xr-x 729 bytes
fc494358Antonio Prates Fix html lang bug 9 months ago
                                                                                
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
#!/usr/bin/env bash

# New Capsule Wizard
# 2021, by Antonio Prates <hello@aprates.dev>
# see provided README.md for more information

############## CHECK ARGUMENTS

if [[ -z $1 ]];
then
    echo "gempress: provide path as argument, like: './new-capsule ~/capsule'"
    exit 1
fi
if [[ -d $1 ]];
then
    echo "gempress: directory '$1' already exists!"
    exit 2
fi

############## SOURCE GEMPRESS LIB

orginalDir=$PWD
cd "$(dirname "${BASH_SOURCE[0]}")"
. ./src/lib.sh

############## CREATE FOLDER

mkdir $1

############## COPY EXAMPLE AND TEMPLATES

cp -r example $1/contents
cp -r template $1/template

############## CONFIGURE

echo
sugar src/configure.c $1 $(date +%F)

############## REVERT TO USER DIR

cd $orginalDir