Skip to content

Commit 219cbda

Browse files
committed
Add dist folder to track main scripts
1 parent 01a4078 commit 219cbda

File tree

6 files changed

+53
-7
lines changed

6 files changed

+53
-7
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
/.idea/
33
/.nb-gradle/
44
**/build/
5-
/dist/
65
/out/
76
/store/
87
/optimizations/

dist/icon.png

8.69 KB
Loading

dist/ownlang

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/usr/bin/env sh
2+
(set -o igncr) 2>/dev/null && set -o igncr; # cygwin encoding fix
3+
4+
# resolve links - $0 may be a softlink
5+
PRG="$0"
6+
while [ -h "$PRG" ] ; do
7+
ls=`ls -ld "$PRG"`
8+
link=`expr "$ls" : '.*-> \(.*\)$'`
9+
if expr "$link" : '/.*' > /dev/null; then
10+
PRG="$link"
11+
else
12+
PRG=`dirname "$PRG"`/"$link"
13+
fi
14+
done
15+
PRGDIR=`dirname "$PRG"`
16+
17+
_classpath=".:$PRGDIR/OwnLang.jar"
18+
if [ `uname -a | grep -i -c cygwin` -ne 0 ]; then # Cygwin, translate the path
19+
for k in "$PRGDIR"/modules/*.jar
20+
do
21+
_classpath="${_classpath};`cygpath -w ${k}`"
22+
done
23+
for k in "$PRGDIR"/libs/*.jar
24+
do
25+
_classpath="${_classpath};`cygpath -w ${k}`"
26+
done
27+
else
28+
for k in "$PRGDIR"/modules/*.jar
29+
do
30+
_classpath="${_classpath}:${k}"
31+
done
32+
for k in "$PRGDIR"/libs/*.jar
33+
do
34+
_classpath="${_classpath}:${k}"
35+
done
36+
fi
37+
38+
java -cp "${_classpath}" com.annimon.ownlang.Main "$@"

dist/ownlang-runner.cmd

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@echo off
2+
set JAVA=java
3+
%JAVA% -cp "%~dp0/*;%~dp0modules/*;%~dp0libs/*" com.annimon.ownlang.Main --file %1
4+
pause

dist/ownlang.cmd

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
@echo off
2+
3+
set JAVA=java
4+
%JAVA% ^
5+
-cp "%~dp0/*;%~dp0modules/*;%~dp0libs/*" com.annimon.ownlang.Main %*

modules/main/src/main/java/com/annimon/ownlang/modules/okhttp/Values.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,22 @@
1414
public class Values {
1515

1616
public static RequestBody getRequestBody(Value arg, String msg) {
17-
if (arg.type() == Types.MAP && (arg instanceof RequestBodyValue)) {
18-
return ((RequestBodyValue) arg).getRequestBody();
17+
if (arg.type() == Types.MAP && (arg instanceof RequestBodyValue rbv)) {
18+
return rbv.getRequestBody();
1919
}
2020
throw new TypeException("RequestBody value expected" + msg);
2121
}
2222

2323
public static Request getRequest(Value arg, String msg) {
24-
if (arg.type() == Types.MAP && (arg instanceof RequestBuilderValue)) {
25-
return ((RequestBuilderValue) arg).getRequest();
24+
if (arg.type() == Types.MAP && (arg instanceof RequestBuilderValue rbv)) {
25+
return rbv.getRequest();
2626
}
2727
throw new TypeException("Request value expected" + msg);
2828
}
2929

3030
public static OkHttpClient getHttpClient(Value arg, String msg) {
31-
if (arg.type() == Types.MAP && (arg instanceof HttpClientValue)) {
32-
return ((HttpClientValue) arg).getClient();
31+
if (arg.type() == Types.MAP && (arg instanceof HttpClientValue hcv)) {
32+
return hcv.getClient();
3333
}
3434
throw new TypeException("HttpClient value expected" + msg);
3535
}

0 commit comments

Comments
 (0)