A make-like program, forked from https://github.com/fdxxw/gmake .
This branch extends some functionality.
Download the latest version from github.
go get -u github.com/3JoB/gmake2Write the gmake.yml file in the current directory, the content is as follows
vars:
msg: Hello World
all: |
@echo {{.msg}}
mg: |
@echo What's up???Then run gmake on the current command line console, you can see the console print
Hello World
Or execute gmake mg to execute the specified command, and the console will print
What's up???
gmake2 automatically selects the all command when no command is specified.
The built-in command is as follows
Print information
@echo msgSet variable
@var msg Hello Worldor
vars:
msg: Hello World
all: |
@echo {{.msg}}Set environment variables
@env GOOS linux
Execute other configured commands.
Example:
all: |
@cmd readme
readme: |
@echo I Like It# Begins with comments
# comment
Create a file
@touch from.txt
Move a file or directory
@mv from.txt to.txt
Copy a file or directory
@copy to.txt from.txt
Delete file or directory
@rm from.txt
Create a directory
@mkdir from
Set the directory to make subsequent console commands run in the specified directory. It is only valid for system commands and invalid for built-in commands.
@cd from
System commands, execute console commands, and execute everything that the console can execute.
go buildexamples.yml
vars:
msg: Hello World
all: |
@echo {{.msg}}
# Modify the msg variable
@var msg Hello
@echo {{.msg}}
# Create a file
@touch from.txt
@mv from.txt to.txt
@copy to.txt from.txt
@rm from.txt
@rm to.txt
@mkdir from
@mv from to
@copy to from
@rm from
@rm to
@env GOOS linux
go buildgmake