Skip to content
This repository has been archived by the owner on Jan 30, 2024. It is now read-only.

save name, twitter and email in file for later use; minor shell improvements #15

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.DS_Store
*slides.txt
presenter.info
43 changes: 34 additions & 9 deletions create_training_slides.sh
Original file line number Diff line number Diff line change
@@ -1,31 +1,56 @@
git submodule init
git submodule update

# save name, twitter and email of the presenter in this file
PRESENTER_INFO_FILE=presenter.info

ADOC_VERSION=$(asciidoctor -v)
if [ ! $? ]; then
echo "Installing AsciiDoctor"
bundle install
else
echo "Installed"
echo $ADOC_VERSION
echo "$ADOC_VERSION"
fi

echo -n "Your Name: "
read name
echo -n "Your Twitter: "
read twitter
echo -n "Your Email: "
read email
function writePresenterInfo {
cat << EOF > "$PRESENTER_INFO_FILE"
name="$name"
twitter="$twitter"
email="$email"
EOF
}

function readPresenterInfo {

# try to read it from file first
if [ -r "$PRESENTER_INFO_FILE" ]; then
echo "Reading name, twitter and email from file: '$PRESENTER_INFO_FILE'"
source "$PRESENTER_INFO_FILE"
else

echo -n "Your Name: "
read name
echo -n "Your Twitter: "
read twitter
echo -n "Your Email: "
read email

writePresenterInfo
fi
}

readPresenterInfo

function create {
./run.sh content/training/$1 -a presenter="$name" -a twitter="$twitter" -a email="$email"
./run.sh "content/training/$1" -a presenter="$name" -a twitter="$twitter" -a email="$email"
}
SLIDES="advanced_cypher/training-advanced-cypher.adoc import/training-data-import.adoc modeling/training-data-modeling.adoc production/training-neo4j-in-production.adoc intro/intro-cypher-movies/training-intro-cypher-movies.adoc intro/intro-cypher-relational/training-intro-cypher-relational.adoc intro/intro-cypher-interactive/training-intro-cypher-interactive.adoc intro/graph-days-movies/training-graph-days-cypher-movies.adoc"


for i in $SLIDES; do
echo "Rendering $i"
create $i
create "$i"
done

./http index.html
Expand Down
13 changes: 9 additions & 4 deletions http
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
#!/bin/sh

if [ "$1" == "" ]; then
# use double aliasing to safely test the passed parameter
if [ "x$1" = "x" ]; then
echo "Usage ./http content/training/intro/intro-cypher-movies/training-intro-cypher-movies.html"
exit 1
fi

# don't know if this is intended... change the order to
# python -m SimpleHTTPServer > /dev/null 2>&1 &
# in order to suppress output messages on the console
python -m SimpleHTTPServer 2>&1 > /dev/null &
URL="http://localhost:8000/$1"
echo $URL
open $URL

URL="http://localhost:8000/$1"
echo "$URL"
open "$URL"