diff options
author | Laria Carolin Chabowski <laria@laria.me> | 2020-04-26 21:51:49 +0200 |
---|---|---|
committer | Laria Carolin Chabowski <laria@laria.me> | 2020-04-27 20:02:45 +0200 |
commit | aecc1b02d82b4f579ac6d25db3470e746b2b47c9 (patch) | |
tree | c13c038d6675937067d184ea65bb86b50b5df977 | |
parent | f9d7a587a23a964be76883f1bd6ef2eee08e756c (diff) | |
download | ratatoeskr-cms-aecc1b02d82b4f579ac6d25db3470e746b2b47c9.tar.gz ratatoeskr-cms-aecc1b02d82b4f579ac6d25db3470e746b2b47c9.tar.bz2 ratatoeskr-cms-aecc1b02d82b4f579ac6d25db3470e746b2b47c9.zip |
build.sh: Extend to include options to set up the dev environment
-rwxr-xr-x | build.sh | 92 | ||||
-rwxr-xr-x | create-package.sh | 37 |
2 files changed, 92 insertions, 37 deletions
diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..6ed7a16 --- /dev/null +++ b/build.sh @@ -0,0 +1,92 @@ +#!/bin/sh + +set -e + +mkdir_if_missing() { + test -d "$1" || mkdir -p "$1" +} + +setup_directories() { + mkdir_if_missing images/previews + mkdir_if_missing ratatoeskr/plugin_extradata/public + mkdir_if_missing ratatoeskr/templates/src/plugintemplates + mkdir_if_missing ratatoeskr/templates/transc + mkdir_if_missing ratatoeskr/libs/ste +} + +install_dependencies() { + cd ratatoeskr/libs + + cd ste + wget https://github.com/silvasur/ste/archive/master.zip + unzip master.zip + cp ste-master/ste.php . + cp -r ste-master/src . + rm -rf ste-master master.zip + cd .. + + wget http://michelf.com/docs/projets/php-markdown-1.0.1o.zip + unzip php-markdown-*.zip + mv PHP\ Markdown\ */markdown.php . + rm -rf PHP\ Markdown\ * + rm php-markdown-*.zip + + wget -O kses.zip http://sourceforge.net/projects/kses/files/kses/0.2.2/kses-0.2.2.zip/download?use_mirror=optimate + unzip kses.zip + mv kses-*/kses.php . + rm -rf kses-* + rm kses.zip + + wget http://code.jquery.com/jquery.min.js +} + +setup_dev_environment() { + setup_directories + install_dependencies +} + +create_release_package() { + git archive --format=tar -o r7r.tar master + mkdir -p package/Ratatoeskr + mv r7r.tar package/Ratatoeskr + + cd package/Ratatoeskr + tar xf r7r.tar + rm r7r.tar + + setup_directories + install_dependencies + + rm session_doctor.php + + cd .. + + zip -r Ratatoeskr.zip Ratatoeskr +} + +case "$1" in +setup_directories) + setup_directories + ;; +install_dependencies) + install_dependencies + ;; +setup_dev_environment) + setup_dev_environment + ;; +create_release_package) + create_release_package + ;; +*) + { + echo "usage: $0 mode" + echo "" + echo "where mode is one of:" + echo "- setup_directories" + echo "- install_dependencies" + echo "- setup_dev_environment" + echo "- create_release_package" + } >&2 + exit 1 + ;; +esac diff --git a/create-package.sh b/create-package.sh deleted file mode 100755 index 293e1d1..0000000 --- a/create-package.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/env bash - -git archive --format=tar -o r7r.tar master -mkdir -p package/Ratatoeskr -mv r7r.tar package/Ratatoeskr -cd package/Ratatoeskr -tar xf r7r.tar -rm r7r.tar -mkdir -p images/previews -cd ratatoeskr/ -mkdir plugin_extradata/public -mkdir templates/src/plugintemplates -mkdir templates/transc -cd libs -test -d ste || mkdir ste -cd ste -wget https://github.com/silvasur/ste/archive/master.zip -unzip master.zip -cp ste-master/ste.php . -cp -r ste-master/src . -rm -rf ste-master master.zip -cd .. -wget http://michelf.com/docs/projets/php-markdown-1.0.1o.zip -unzip php-markdown-*.zip -mv PHP\ Markdown\ */markdown.php . -rm -rf PHP\ Markdown\ * -rm php-markdown-*.zip -wget -O kses.zip http://sourceforge.net/projects/kses/files/kses/0.2.2/kses-0.2.2.zip/download?use_mirror=optimate -unzip kses.zip -mv kses-*/kses.php . -rm -rf kses-* -rm kses.zip -wget http://code.jquery.com/jquery.min.js -cd ../.. -rm session_doctor.php -cd .. -zip -r Ratatoeskr.zip Ratatoeskr |