From 31c251883a0a70d3fcbe11558cbc3098098e134e Mon Sep 17 00:00:00 2001 From: mertcandav Date: Thu, 28 Mar 2024 18:00:59 +0300 Subject: [PATCH] add build scripts --- .gitignore | 4 +--- brun.sh | 18 ++++++++++++++++++ build.sh | 18 ++++++++++++++++++ 3 files changed, 37 insertions(+), 3 deletions(-) create mode 100644 brun.sh create mode 100644 build.sh diff --git a/.gitignore b/.gitignore index 1ee7476..c11f1b4 100644 --- a/.gitignore +++ b/.gitignore @@ -5,8 +5,7 @@ *.so *.dylib main -julec -!julec/ +julefmt # Dist dist/ @@ -34,4 +33,3 @@ __* # Vim swap files *.swp - diff --git a/brun.sh b/brun.sh new file mode 100644 index 0000000..df383f3 --- /dev/null +++ b/brun.sh @@ -0,0 +1,18 @@ +#!/bin/bash +# Copyright 2024 The Jule Programming Language. +# Use of this source code is governed by a BSD 3-Clause +# license that can be found in the LICENSE file. + +if [ -f ./src/main.jule ]; then + julec --opt-deadcode -o julefmt ./src +else + echo "error: working directory is not root directory" + exit +fi + +if [ $? -eq 0 ]; then + ./julefmt $@ +else + echo "-----------------------------------------------------------------------" + echo "An unexpected error occurred while compiling JuleFmt. Check errors above." +fi diff --git a/build.sh b/build.sh new file mode 100644 index 0000000..37c50bc --- /dev/null +++ b/build.sh @@ -0,0 +1,18 @@ +#!/bin/bash +# Copyright 2024 The Jule Programming Language. +# Use of this source code is governed by a BSD 3-Clause +# license that can be found in the LICENSE file. + +if [ -f ./src/main.jule ]; then + julec --opt-deadcode -o julefmt ./src +else + echo "error: working directory is not root directory" + exit +fi + +if [ $? -eq 0 ]; then + echo "Compilation successful!" +else + echo "-----------------------------------------------------------------------" + echo "An unexpected error occurred while compiling JuleFmt. Check errors above." +fi