mirror of
https://github.com/zunit-zsh/zunit.git
synced 2026-09-10 06:36:15 -04:00
Switch from Makefile to simple ZSH build script
This commit is contained in:
parent
4f256c7d58
commit
ceba65a207
12
Makefile
12
Makefile
|
|
@ -1,12 +0,0 @@
|
|||
target:
|
||||
@cat /dev/null > zunit
|
||||
@echo "#!/usr/bin/env zsh\n" >> zunit
|
||||
@cat src/reports/*.zsh >> zunit
|
||||
@cat $(filter-out src/zunit.zsh,$(wildcard src/*.zsh)) >> zunit
|
||||
@cat src/commands/*.zsh >> zunit
|
||||
@cat src/zunit.zsh >> zunit
|
||||
@chmod u+x zunit
|
||||
@echo "\033[0;32m✔\033[0;m ZUnit built successfully"
|
||||
|
||||
test:
|
||||
@./zunit
|
||||
23
build.zsh
Executable file
23
build.zsh
Executable file
|
|
@ -0,0 +1,23 @@
|
|||
#!/usr/bin/env zsh
|
||||
|
||||
# Clear the file to start with
|
||||
cat /dev/null > zunit
|
||||
|
||||
# Start with the shebang
|
||||
echo "#!/usr/bin/env zsh\n" >> zunit
|
||||
|
||||
# We need to do some fancy globbing
|
||||
setopt EXTENDED_GLOB
|
||||
|
||||
# Print each of the source files into the target, removing any comments
|
||||
# and blank lines from the compiled executable
|
||||
cat src/**/(^zunit).zsh | grep -v -E '^(\s*#.*[^"]|\s*)$' >> zunit
|
||||
|
||||
# Print the main command last
|
||||
cat src/zunit.zsh | grep -v -E '^(\s*#.*[^"]|\s*)$' >> zunit
|
||||
|
||||
# Make sure the file is executable
|
||||
chmod u+x zunit
|
||||
|
||||
# Let the user know we're finished
|
||||
echo "\033[0;32m✔\033[0;m ZUnit built successfully"
|
||||
Loading…
Reference in a new issue