-
Notifications
You must be signed in to change notification settings - Fork 1
/
runit.bat
90 lines (82 loc) · 2.51 KB
/
runit.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
@echo off
Rem Blue Mug is a programming environment for C/C++ built upon MinGW and notepad++.
Rem Copyright (C) 2018 Abhigyan Prakash
Rem This program is free software: you can redistribute it and/or modify
Rem it under the terms of the GNU General Public License as published by
Rem the Free Software Foundation, either version 3 of the License, or
Rem (at your option) any later version.
Rem This program is distributed in the hope that it will be useful,
Rem but WITHOUT ANY WARRANTY; without even the implied warranty of
Rem MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Rem GNU General Public License for more details.
Rem You should have received a copy of the GNU General Public License
Rem along with this program.
set path=%systemdrive%\mingw\bin;%systemdrive%\nodejs;%PYTHONBIN%;%path%
cls
Rem %1 - where run_fildg is located i.e. home
Rem this step is to prevent problems caused by slash while calling fildgpath
Rem in the for statement below.
if [%1]==[] ( set "fildgpath=" ) else ( set "fildgpath=%~1\")
:select
title RUN
cls
color 1f
setlocal enabledelayedexpansion
echo.
echo. Choose a program to run
echo.
FOR /F "usebackq delims=" %%j IN (`%PYTHONBIN%python.exe "%fildgpath%run_fildg.py"`) DO set filename=%%j
:runag
cls
echo.
title RUN: !filename!
color 2F
if defined filename (
echo.
cls
echo.*******************************************************************************
echo.
echo. SUPPLY ARGUMENTS
echo.
echo. Please supply arguments - if any
echo.
echo. Then, press Enter to continue.
echo.
echo.
echo.
echo.
set /p "args=!filename! "
cls
echo.*******************************************************************************
echo.
echo. EXECUTION / OUTPUT
echo.
if !filename:~-2! EQU js call "%systemdrive%\nodejs\node" "!filename!" !args! & set "args=" & goto runagask
if !filename:~-2! EQU py call !PYTHONBIN!python "!filename!" !args! & set "args=" & goto runagask
Rem to run c and c++
"!filename!" !args!
set "args="
echo.
goto runagask
) else (
echo: No files selected.
echo.
goto runan )
Rem Run-again-ask
:runagask
echo.
echo. RUN SUCCESSFUL
echo.
CHOICE /C YN /M "Run the same prog again?"
if %errorlevel% EQU 1 GOTO runag
if %errorlevel% EQU 2 set "filename="
Rem Run-another
:runan
cls
endlocal
echo.
echo.
echo.
CHOICE /C YN /M "Run another program?"
IF %errorlevel% EQU 1 ( GOTO select )
IF %errorlevel% EQU 2 ( GOTO :EOF )