Skip to content

Commit

Permalink
Merge pull request #207 from romanowski/more-gifs
Browse files Browse the repository at this point in the history
Add more gifs
  • Loading branch information
romanowski committed Oct 12, 2021
2 parents d22aa44 + a9fbbc7 commit 036379a
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 11 deletions.
5 changes: 5 additions & 0 deletions gifs/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ RUN cd /data
RUN echo 'def a = 123' > a.scala
RUN scala-cli compile a.scala || echo "Problems with bloop"

RUN apt-get install -y clang

RUN curl -fsSL https://deb.nodesource.com/setup_12.x | bash -
RUN apt-get install -y nodejs

RUN apt-get install -y rubygems
RUN gem install rouge

Expand Down
16 changes: 14 additions & 2 deletions gifs/scenarios/complete-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,27 @@ SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" &> /dev/null && pwd)

if [[ -z "${ASCIINEMA_REC}" ]]; then
# Warm up scala-cli
echo "println(1)" | scala-cli -
apt-get purge -y scala-cli
# or do other preparation (e.g. create code)
else
. $SCRIPT_DIR/../demo-magic.sh
# # hide the evidence
clear

# Put your stuff here
pe "echo 'println(\"TODO: turn gifs/scenarios/complete-install.sh into proper scenario showing Complete installation\")' | scala-cli -"
p scala-cli
scala-cli
p java
java

sleep 2

pe "curl -sSLf https://virtuslab.github.io/scala-cli-packages/scala-setup.sh | sh"
pe 'source ~/.profile'
# pe "echo 'println(\"TODO: turn gifs/scenarios/complete-install.sh into proper scenario showing Complete installation\")' | scala-cli -"

pe "echo 'println(\"Hello from scala-cli\")' | scala-cli -"


# Wait a bit to read output of last command
sleep 2
Expand Down
2 changes: 1 addition & 1 deletion gifs/scenarios/demo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ EOF

pe "scala-cli demo.scala -- Ala jake Mike"

sleep 2
sleep 5

clear

Expand Down
27 changes: 23 additions & 4 deletions gifs/scenarios/universal_tool.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,35 @@ SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" &> /dev/null && pwd)
if [[ -z "${ASCIINEMA_REC}" ]]; then
# Warm up scala-cli
echo "println(1)" | scala-cli -
echo "println(1)" | scala-cli --js - &&
echo "println(1)" | scala-cli --native -S 2 -

# or do other preparation (e.g. create code)
else
. $SCRIPT_DIR/../demo-magic.sh
# # hide the evidence
clear

# Put your stuff here
pe "echo 'println(\"TODO: turn gifs/scenarios/universal_tool.sh into proper scenario showing Universal tool" key="universal\")' | scala-cli -"
cat <<EOF | updateFile js.scala
@main def jsMain =
import scala.scalajs.js.Dynamic.global
println(s"Node js version: \${global.process.version}")
EOF

pe "scala-cli --js js.scala"
sleep 3
clear

cat <<EOF | updateFile native.scala
object Native extends App {
import scala.scalanative.posix.limits
println(s"Max path lenght in this OS is \${limits.PATH_MAX}")
}
EOF

pe "# Scala Native works only with Scala 2.x so far"
pe "scala-cli --native -S 2 native.scala"
sleep 3

# Wait a bit to read output of last command
sleep 2
echo " "
fi
2 changes: 1 addition & 1 deletion website/static/img/complete-install.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion website/static/img/dark/complete-install.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion website/static/img/dark/universal_tool.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion website/static/img/universal_tool.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 036379a

Please sign in to comment.