forked from sass/sass-spec
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgen_libsass_todo.cmd
73 lines (50 loc) · 1.54 KB
/
gen_libsass_todo.cmd
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
@echo off
SETLOCAL
SET EXEC=%~0
SET ISSUE=%1
REM split exec into parts
For %%F IN ("%EXEC%") do (
Set FOLDER=%%~dpF
Set NAME=%%~nxF
)
REM test if we have an issue nr
if [%1] == [] GOTO :NoIssue
SET SPECS=%FOLDER%..\spec
if not exist "%ISSUE%.scss" (
echo input source not found: %ISSUE%.scss
goto :End
)
SET GITCMD=git -C "%FOLDER%.."
%GITCMD% fetch --all
%GITCMD% checkout -f -B todo/issue_%ISSUE% master
if exist "%SPECS%\libsass-closed-issues\issue_%ISSUE%" GOTO :IsClosed
if exist "%SPECS%\libsass-closed-issues\issue_%ISSUE%.hrx" GOTO :IsClosed
if not exist "%SPECS%\libsass-todo-issues\issue_%ISSUE%" (
mkdir "%SPECS%\libsass-todo-issues\issue_%ISSUE%"
)
set ROOT=%SPECS%\libsass-todo-issues\issue_%ISSUE%
copy %ISSUE%.scss %ROOT%\input.scss
sass %ROOT%\input.scss %ROOT%\output.css ^
--no-source-map
if exist "%ROOT%.hrx" del %ROOT%.hrx
echo ^<===^> input.scss >> %ROOT%.hrx
type %ROOT%\input.scss >> %ROOT%.hrx
echo ^<===^> output.css >> %ROOT%.hrx
type %ROOT%\output.css >> %ROOT%.hrx
del %ROOT%\input.scss
del %ROOT%\output.css
dos2unix %ROOT%.hrx
%GITCMD% add %ROOT%.hrx
%GITCMD% commit -m "Add todo spec test for libsass issue %ISSUE%" ^
-m "" -m "https://github.com/sass/libsass/issues/%ISSUE%"
echo You may push the branch to your remote repository now
if [%2] == [] GOTO :End
echo Going to push to remote %2
%GITCMD% push %2 todo/issue_%ISSUE%
GOTO :End
:IsClosed
echo Issue seems to be closed already
:NoIssue
echo Please pass an issue number
GOTO :End
:End