forked from marcelinhov2/framework
-
Notifications
You must be signed in to change notification settings - Fork 0
/
polvo-skel
81 lines (61 loc) · 2.13 KB
/
polvo-skel
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#!/bin/sh
# NOTES:
# - This script takes only one argument (desired path to create the app)
# - It uses uses coffeescript, stylus and jade to as sample files/code
# - Its intended to be just an example for getting started, and nothing more
# - For more info on Polvo, check the project Site and README:
# http://polvo.io
# https://github.com/polvo/polvo
# USAGE
# 1. Download this script and put it somewhere in your machine
# 2. chmod +x ~/path/where/you/put/polvo-skel
# 3. Run the script passing the path where the app should be created, i.e.:
# ~/path/where/you/put/polvo-skel ~/sample-project
# 4. Visit http://localhost:3000
# creating dirs
# ------------------------------------------------------------------------------
mkdir $1 && cd $1
mkdir -p $PWD/{src/app,src/styles,src/templates,public}
# creating html index file
# ------------------------------------------------------------------------------
echo "<html>
<head>
<title></title>
<link rel='stylesheet' type='text/css' href='/app.css'>
<script type='text/javascript' src='http://code.jquery.com/jquery-2.0.3.min.js'></script>
<script type='text/javascript' src='/app.js'></script>
</head>
<body>
</body>
</html>" > $PWD/public/index.html
# creating config file
# ------------------------------------------------------------------------------
echo "
server:
root: ./public
port: 3000
input:
- ./src
output:
js: ./public/app.js
css: ./public/app.css
boot: ./src/app/app
" > $PWD/polvo.yml
# creating script entry point
# ------------------------------------------------------------------------------
echo "
template = require '../templates/main'
\$(document).ready ->
\$('body').html template name: 'Bender'
" > src/app/app.coffee
# creating sample template
# ------------------------------------------------------------------------------
echo "h1 Hello World, #{name}" > src/templates/main.jade
# creating sample style
# ------------------------------------------------------------------------------
echo "h1
color green
" > src/styles/main.styl
# starting app
# ------------------------------------------------------------------------------
cd $PWD && polvo -ws