txlyre 1 year ago
parent
commit
c3ac3e2812
7 changed files with 10 additions and 10 deletions
  1. 1 1
      langs/ada/run.sh
  2. 4 4
      langs/asm/run.sh
  3. 1 1
      langs/c/run.sh
  4. 1 1
      langs/cpp/run.sh
  5. 1 1
      langs/fortran/run.sh
  6. 1 1
      langs/pascal/run.sh
  7. 1 1
      langs/rust/run.sh

+ 1 - 1
langs/ada/run.sh

@@ -5,6 +5,6 @@ cat > "$IN"
 
 gnatmake "$IN" -o "$OUT" -w -gnatws
 
-if [ -f $OUT ] && ! [ -s $OUT ]; then
+if [ $? -eq 0 ]; then
   exec "$OUT"
 fi

+ 4 - 4
langs/asm/run.sh

@@ -5,10 +5,10 @@ TEMP="$(mktemp --suffix .o)"
 cat > "$IN"
 
 nasm -felf64 "$IN" -o "$TEMP"
-if [ -f $TEMP ] && ! [ -s $TEMP ]; then
+if [ $? -eq 0 ]; then
   ld "$TEMP" -o "$OUT"
-fi
-
-if [ -f $OUT ] && ! [ -s $OUT ]; then
+  if [ $? -eq 0 ]; then
+    chmod +x "$OUT"
     exec "$OUT"
+  fi
 fi

+ 1 - 1
langs/c/run.sh

@@ -2,6 +2,6 @@ OUT="$(mktemp)"
 
 gcc -o "$OUT" -xc -
 
-if [ -f $OUT ] && ! [ -s $OUT ]; then
+if [ $? -eq 0 ]; then
   exec "$OUT"
 fi

+ 1 - 1
langs/cpp/run.sh

@@ -2,6 +2,6 @@ OUT="$(mktemp)"
 
 g++ -o "$OUT" -xc++ -
 
-if [ -f $OUT ] && ! [ -s $OUT ]; then
+if [ $? -eq 0 ]; then
   exec "$OUT"
 fi

+ 1 - 1
langs/fortran/run.sh

@@ -5,6 +5,6 @@ cat > "$IN"
 
 gfortran -o "$OUT" "$IN"
 
-if [ -f $OUT ] && ! [ -s $OUT ]; then
+if [ $? -eq 0 ]; then
   exec "$OUT"
 fi

+ 1 - 1
langs/pascal/run.sh

@@ -5,6 +5,6 @@ cat > "$IN"
 
 fpc -l- -v0 -o"$OUT" "$IN"
 
-if [ -f $OUT ] && ! [ -s $OUT ]; then
+if [ $? -eq 0 ]; then
   exec "$OUT"
 fi

+ 1 - 1
langs/rust/run.sh

@@ -2,6 +2,6 @@ OUT="$(mktemp)"
 
 rustc -o "$OUT" -
 
-if [ -f $OUT ]; then
+if [ $? -eq 0 ]; then
   exec "$OUT"
 fi