Skip to content

Commit

Permalink
Merge pull request #70 from berttejeda/setup/cx_freeze-start-tutorial
Browse files Browse the repository at this point in the history
Setup/cx freeze start tutorial
  • Loading branch information
berttejeda authored Oct 10, 2019
2 parents 64a5d3a + e91dc3c commit f594e6b
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Makefile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,8 @@
mkdir -p ${pandoc_template_dir}
git clone https://github.com/ryangrose/easy-pandoc-templates ${pandoc_template_dir}
fi
mkdir ${app_dir}/dist
pandoc README.md -f markdown -o ansible_taskrunner/build/README.html --template=${pandoc_template_dir}/html/clean_menu.html --toc
if ! test -d ${app_dir}/dist;then mkdir ${app_dir}/dist;fi
pandoc README.md -f markdown -o ansible_taskrunner/build/README.html --template=${pandoc_template_dir}/html/easy_template.html --toc
cd ${app_dir}
python setup.cx_freeze.py bdist_msi
zipapp:
Expand Down
1 change: 0 additions & 1 deletion ansible_taskrunner/files/macros/default.mac
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,5 @@ pwd = cd
qq=exit
rm = del $*
rmr = echo 'Recursively Deleting $* ... $T rmdir /s /q $* $T echo Finished deleting $*
start-tutorial = (explorer C:\PROGRA~2\ANSIBL~1\README.html && tasks --help)
sudo = runas /user:administrator $*
yum="C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -sta -ExecutionPolicy Unrestricted -File "%~dp0scripts\$1.ps1" -package $2
45 changes: 45 additions & 0 deletions ansible_taskrunner/files/start-tutorial.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
@echo off
:: Ghost typer
setlocal enableextensions enabledelayedexpansion

set lines=3

set "line1=tasks --help"
set "line2=."
set "line3=."

echo Enter in 'tasks --help' to display basic usage
ping localhost -n 1 >NUL

call :example
tasks --help

call :wait 1

echo Launching README in 5 seconds ...
call :wait 5
explorer C:\PROGRA~2\ANSIBL~1\README.html

goto :EOF

:wait
ping localhost -n %~1 >NUL
goto :EOF

:example
for /f %%a in ('"prompt $H&for %%b in (1) do rem"') do set "BS=%%a"
for /L %%a in (1,1,%lines%) do set num=0&set "line=!line%%a!"&call :type
goto :EOF

:type
set "letter=!line:~%num%,1!"
set "delay=%random%%random%%random%%random%%random%%random%%random%"
set "delay=%delay:~-2%"
if not "%letter%"=="" set /p "=a%bs%%letter%" <nul

:: adjust the 3 in the line below: higher is faster typing speed

for /L %%b in (1,2,%delay%) do rem
if "%letter%"=="" echo.&goto :EOF
set /a num+=1
goto :type
6 changes: 3 additions & 3 deletions ansible_taskrunner/files/tasks-console.bat
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@echo off
mode con: cols=100 lines=25
mode con: cols=180 lines=40
setlocal EnableDelayedExpansion
(set \n=^
%=Do not remove this line=%
Expand Down Expand Up @@ -62,12 +62,12 @@ goto:eof
:WINDOWS_7
echo.
echo Windows 7 Detected
call :stat-app git "https://git-scm.com/download/win"
call :stat-app git "https://git-scm.com/download/win ('Checkout as-is/Unix-style line endings')"
echo.
goto:eof

:stat-app
echo.
dir "%~1" 2> nul 1> nul || echo Error: %~1 not found!\n!1. Install via %~2 %~3
where "%~1" 2> nul 1> nul || echo Error: %~1 not found!\n!1. Install via %~2
echo.
goto:eof
1 change: 1 addition & 0 deletions ansible_taskrunner/setup.cx_freeze.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
# Include support files
include_files = [
'build/README.html',
'files/start-tutorial.bat',
'files/tasks-console.bat',
'files/cfg',
'files/macros'
Expand Down

0 comments on commit f594e6b

Please sign in to comment.