-
Notifications
You must be signed in to change notification settings - Fork 1
/
folderloc.bat
47 lines (40 loc) · 1.39 KB
/
folderloc.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
@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.
REM %1 - the place where loc.wsp is
REM %2 - the place where get_wspFolder.py is located i.e. home
setlocal
color 3f
echo.
echo: ...Please select your workspace folder...
echo.
setlocal enabledelayedexpansion
FOR /F "usebackq delims=" %%j IN (`%PYTHONBIN%python.exe "%~2\get_wspFolder.py"`) DO set folder=%%j
if defined folder (
type nul > "%~1\loc.wsp"
if !folder:~-2!==:\ set "folder=%folder:~0,-1%"
>> "%~1\loc.wsp" echo !folder!
echo.
echo:Your new workspace - !folder!
echo:
pause
) else (
echo.
echo.No folder selected...Work space remains unchanged
echo.
type "%~1\loc.wsp"
echo.
pause
)
endlocal
GOTO :EOF