Skip to content

Instantly share code, notes, and snippets.

@clsource
Created August 9, 2020 20:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save clsource/90f860c3bb16286d1d4cc6e1ecb19db0 to your computer and use it in GitHub Desktop.
Save clsource/90f860c3bb16286d1d4cc6e1ecb19db0 to your computer and use it in GitHub Desktop.
Example of Makefiles in Windows
root = true
[*]
end_of_line = lf
insert_final_newline = true
indent_size = 2
indent_style = space
[Makefile]
indent_style = tab
[*.bat]
end_of_line = crlf
@echo off
set CONTAINER=mycontainer
if /i "%1"=="install" goto install
if /i "%1"=="i" goto install
if /i "%1"=="stop" goto stop
if /i "%1"=="s" goto stop
goto install
:install
start /wait /B docker-compose up -d
start /wait /B docker exec %CONTAINER% composer install
start /wait /B docker exec %CONTAINER% npm install
goto :eof
:stop
start /wait /B docker-compose down -v
goto :eof
# http://users.csc.calpoly.edu/~gfisher/classes/309/lib/falcon-Makefiles/makefile-to-bat-file.html
# https://github.com/espositoandrea/Make-to-Batch/blob/master/make.bat
# https://superuser.com/a/717465
CONTAINER=mycontainer
i install:
docker-compose up -d
docker exec $(CONTAINER) composer install
docker exec $(CONTAINER) npm install
s stop:
docker-compose down -v
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment