Skip to content

Commit b5b5eab

Browse files
committed
display
1 parent 0a6cccb commit b5b5eab

File tree

10 files changed

+33
-3
lines changed

10 files changed

+33
-3
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../lib
36.5 KB
Binary file not shown.
2.24 MB
Binary file not shown.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
app [main] {
2+
pf: platform "../../../platforms/go/main.roc"
3+
}
4+
import Lib.Display as Display
5+
main : Str
6+
main = Display.str [
7+
["Roc", "<3", "Go", "!", "!", "!"],
8+
["This", "is", "a", "Roc", "application", "running", "on", "Go."],
9+
["It", "imports", "a", "Roc", "module", "and", "calls", "a", "function", "from", "it."],
10+
]
0 Bytes
Binary file not shown.

pkgs/roc/lib/Display.roc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module [str]
2+
str : List (List Str) -> Str
3+
str = |lines| lines
4+
|> List.map (\ws -> Str.join_with(ws, " "))
5+
|> Str.join_with("\n")

pkgs/roc/platforms/go/Lib

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../lib

pkgs/roc/platforms/go/dynhost

0 Bytes
Binary file not shown.

pkgs/roc/platforms/go/linux-x64.rh

0 Bytes
Binary file not shown.

pkgs/roc/scripts/build.sh

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,24 @@ while true; do
3434
--help) usage ;;
3535
--)
3636
shift
37+
# break
38+
;;
39+
# *) usage ;;
40+
*)
41+
if [ -z "$1" ]; then
42+
usage
43+
fi
44+
application=$1
45+
if [ "$#" -lt 2 ]; then
46+
break
47+
fi
48+
platform=$1
3749
break
3850
;;
39-
*) usage ;;
4051
esac
4152
done
53+
platform=${platform:-go}
54+
application=${application:-hello}
4255

4356
platform_path=${PLATFORM_PATH:-platforms/${platform}}
4457
app_path=${APPLICATION_PATH:-applications/${application}/${platform}}
@@ -48,10 +61,10 @@ app_path=${APPLICATION_PATH:-applications/${application}/${platform}}
4861
echo "missing dirs: $platform_path or $app_path"
4962
exit 1
5063
}
51-
if [ -z "$platform_path/Lib" ]; then
64+
if [ ! -d "$platform_path/Lib" ]; then
5265
ln -s ../../lib "$platform_path/Lib"
5366
fi
54-
if [ -z "$app_path/Lib" ]; then
67+
if [ ! -d "$app_path/Lib" ]; then
5568
ln -s ../../../lib "$app_path/Lib"
5669
fi
5770
app_main=$app_path/main.roc

0 commit comments

Comments
 (0)