Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100755 87 lines (63 sloc) 1.448 kB
9178c83 @milkypostman Merge everything.
milkypostman authored
1 #!/bin/bash
2
63213c4 @milkypostman Completion of reorganization.
milkypostman authored
3 BASEDIR=`dirname $0`
4
2d6dcf4 @milkypostman Further updates to directory changing problems.
milkypostman authored
5 cd ${BASEDIR} || exit 1
6
c28172d @milkypostman Improve the look of the webpage. Add some CSS!
milkypostman authored
7
63213c4 @milkypostman Completion of reorganization.
milkypostman authored
8 function melpa_clear_packages {
9 echo "*** Clearing the packages folder..."
ec662f8 @genehack Add '-f' to 'rm' command to silence error when directory is empty
genehack authored
10 rm -rf packages/*
9178c83 @milkypostman Merge everything.
milkypostman authored
11 echo
12 }
13
14
15 function melpa_build_pkglist {
16 echo "*** Building all packages..."
9cac213 @genehack Remove '-u dcurtis' from package-build invocation
genehack authored
17 emacs --batch -l package-build.el --eval "(package-build-all)"
9178c83 @milkypostman Merge everything.
milkypostman authored
18 echo
19 }
20
21 function melpa_generate_html {
f9ae73d @milkypostman rename webpage directory to html
milkypostman authored
22 echo "*** Building html"
23 cd html || return 1
9a2e122 @milkypostman Fix the index update process
milkypostman authored
24 erb index.erb > index.md
27ecad6 @milkypostman Use an html template for Pandoc.
milkypostman authored
25 pandoc --template=template.html --css=style.css -s --mathml -t html --smart index.md > index.html
2d6dcf4 @milkypostman Further updates to directory changing problems.
milkypostman authored
26 cd ..
9178c83 @milkypostman Merge everything.
milkypostman authored
27 echo
28 }
29
a80de95 @milkypostman add a validation step comparing files generated to number in pkglist
milkypostman authored
30 function trim {
31 echo $1
32 }
33
34 function melpa_validate {
96ef230 @genehack Fix validation
genehack authored
35 NUMPACKAGES=$(trim `ls recipes/* | wc -l`)
a80de95 @milkypostman add a validation step comparing files generated to number in pkglist
milkypostman authored
36 NUMBUILT=$(trim `ls packages/*.{el,tar} | wc -l`)
37
38 echo "${NUMBUILT}/${NUMPACKAGES} packages built"
39 }
40
be8ed00 @milkypostman Better option handling.
milkypostman authored
41 function print_usage {
644077a @milkypostman don't build the syncing mechanism into the melpa script
milkypostman authored
42 echo "usage: $0 [-h | -?] [clear | build | html | validate]"
be8ed00 @milkypostman Better option handling.
milkypostman authored
43 }
44
45 args=`getopt h $*`
46 errcode=$?
47
48 if [[ "$errcode" > 0 ]]; then
49 print_usage
50 exit $errcode
51 fi
52
53 set -- $args
54
55 for i; do
56 case "$i" in
d6811f8 @milkypostman error with the pattern matching ?
milkypostman authored
57 -h | -\?) print_usage
be8ed00 @milkypostman Better option handling.
milkypostman authored
58 shift
59 exit
60 ;;
61 --) shift
62 break
63 ;;
64 esac
65 done
66
63213c4 @milkypostman Completion of reorganization.
milkypostman authored
67
68 if [[ "$#" == "0" ]]; then
644077a @milkypostman don't build the syncing mechanism into the melpa script
milkypostman authored
69 set -- clear build index validate
63213c4 @milkypostman Completion of reorganization.
milkypostman authored
70 fi
71
be8ed00 @milkypostman Better option handling.
milkypostman authored
72 for i; do
73 case $i in
63213c4 @milkypostman Completion of reorganization.
milkypostman authored
74 clear ) melpa_clear_packages ;;
75 build ) melpa_build_pkglist ;;
b1d3db4 @milkypostman Fix problems with changing directories.
milkypostman authored
76 html | index ) melpa_generate_html ;;
a80de95 @milkypostman add a validation step comparing files generated to number in pkglist
milkypostman authored
77 validate ) melpa_validate ;;
63213c4 @milkypostman Completion of reorganization.
milkypostman authored
78 esac
79 shift
80 done
81
be8ed00 @milkypostman Better option handling.
milkypostman authored
82 exit 1
83
84
85
9178c83 @milkypostman Merge everything.
milkypostman authored
86
Something went wrong with that request. Please try again.