Skip to content

Commit

Permalink
Merge pull request #2 from wevtoolbox/update-name
Browse files Browse the repository at this point in the history
Updated name, README and LICENSE
  • Loading branch information
BoGnY authored May 13, 2024
2 parents e0f6f1f + 86f2acc commit 4571852
Show file tree
Hide file tree
Showing 17 changed files with 156 additions and 150 deletions.
24 changes: 12 additions & 12 deletions .ci/fuzzy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ function fuzzy() {
###
### 1 Argument
###
cmd="${MY_PATH}/../bin/vhost-gen -${arg1} ${val1}"
cmd="${MY_PATH}/../bin/vhost-generator -${arg1} ${val1}"
out="$( eval "${cmd}" 2>&1 || true )"
if errored "${out}"; then
printf "[%04d] %s\n" "${count}" "${cmd}"
echo "${out}"
exit 1
fi
cmd="${MY_PATH}/../bin/vhost-gen -p ${val1}"
cmd="${MY_PATH}/../bin/vhost-generator -p ${val1}"
out="$( eval "${cmd}" 2>&1 || true )"
if errored "${out}"; then
printf "[%04d] %s\n" "${count}" "${cmd}"
Expand All @@ -61,14 +61,14 @@ function fuzzy() {
###
### 2 Arguments
###
cmd="${MY_PATH}/../bin/vhost-gen -${arg1} ${val1} -${arg2} ${val2}"
cmd="${MY_PATH}/../bin/vhost-generator -${arg1} ${val1} -${arg2} ${val2}"
out="$( eval "${cmd}" 2>&1 || true )"
if errored "${out}"; then
printf "[%04d] %s\n" "${count}" "${cmd}"
echo "${out}"
exit 1
fi
cmd="${MY_PATH}/../bin/vhost-gen -p ${val1} -n NAME"
cmd="${MY_PATH}/../bin/vhost-generator -p ${val1} -n NAME"
out="$( eval "${cmd}" 2>&1 || true )"
if errored "${out}"; then
printf "[%04d] %s\n" "${count}" "${cmd}"
Expand All @@ -79,14 +79,14 @@ function fuzzy() {
###
### 3 Arguments
###
cmd="${MY_PATH}/../bin/vhost-gen -${arg1} ${val1} -${arg2} ${val2} -${arg3} ${val3}"
cmd="${MY_PATH}/../bin/vhost-generator -${arg1} ${val1} -${arg2} ${val2} -${arg3} ${val3}"
out="$( eval "${cmd}" 2>&1 || true )"
if errored "${out}"; then
printf "[%04d] %s\n" "${count}" "${cmd}"
echo "${out}"
exit 1
fi
cmd="${MY_PATH}/../bin/vhost-gen -p ${val1} -n NAME -${arg3} ${val3}"
cmd="${MY_PATH}/../bin/vhost-generator -p ${val1} -n NAME -${arg3} ${val3}"
out="$( eval "${cmd}" 2>&1 || true )"
if errored "${out}"; then
printf "[%04d] %s\n" "${count}" "${cmd}"
Expand All @@ -97,14 +97,14 @@ function fuzzy() {
###
### 4 Arguments
###
cmd="${MY_PATH}/../bin/vhost-gen -${arg1} ${val1} -${arg2} ${val2} -${arg3} ${val3} -${arg4} ${val4}"
cmd="${MY_PATH}/../bin/vhost-generator -${arg1} ${val1} -${arg2} ${val2} -${arg3} ${val3} -${arg4} ${val4}"
out="$( eval "${cmd}" 2>&1 || true )"
if errored "${out}"; then
printf "[%04d] %s\n" "${count}" "${cmd}"
echo "${out}"
exit 1
fi
cmd="${MY_PATH}/../bin/vhost-gen -p ${val1} -n NAME -${arg3} ${val3} -${arg4} ${val4}"
cmd="${MY_PATH}/../bin/vhost-generator -p ${val1} -n NAME -${arg3} ${val3} -${arg4} ${val4}"
out="$( eval "${cmd}" 2>&1 || true )"
if errored "${out}"; then
printf "[%04d] %s\n" "${count}" "${cmd}"
Expand All @@ -115,14 +115,14 @@ function fuzzy() {
###
### 5 Arguments
###
cmd="${MY_PATH}/../bin/vhost-gen -${arg1} ${val1} -${arg2} ${val2} -${arg3} ${val3} -${arg4} ${val4} -${arg5} ${val5}"
cmd="${MY_PATH}/../bin/vhost-generator -${arg1} ${val1} -${arg2} ${val2} -${arg3} ${val3} -${arg4} ${val4} -${arg5} ${val5}"
out="$( eval "${cmd}" 2>&1 || true )"
if errored "${out}"; then
printf "[%04d] %s\n" "${count}" "${cmd}"
echo "${out}"
exit 1
fi
cmd="${MY_PATH}/../bin/vhost-gen -p ${val1} -n NAME -${arg3} ${val3} -${arg4} ${val4} -${arg5} ${val5}"
cmd="${MY_PATH}/../bin/vhost-generator -p ${val1} -n NAME -${arg3} ${val3} -${arg4} ${val4} -${arg5} ${val5}"
out="$( eval "${cmd}" 2>&1 || true )"
if errored "${out}"; then
printf "[%04d] %s\n" "${count}" "${cmd}"
Expand All @@ -137,12 +137,12 @@ function fuzzy() {
### Round 1 (Supported Options only)
###
declare -a args=(c p n t s o)
declare -a vals="(./ ./etc ./etc/conf.yml ./examples/conf.nginx.yml ./examples/conf.apache22.yml ./examples/conf.apache24.yml ./etc/templates ../ ../etc ../etc/conf.yml ../examples/conf.nginx.yml ../examples/conf.apache22.yml ../examples/conf.apache24.yml ../etc/templates ../../ ../../etc ../../etc/conf.yml ../../examples/conf.nginx.yml ../../examples/conf.apache22.yml ../../examples/conf.apache24.yml ../../etc/templates /etc /etc/vhost-gen /etc/vhost-gen/conf.yml /etc/vhost-gen/templates)"
declare -a vals="(./ ./etc ./etc/conf.yml ./examples/conf.nginx.yml ./examples/conf.apache22.yml ./examples/conf.apache24.yml ./etc/templates ../ ../etc ../etc/conf.yml ../examples/conf.nginx.yml ../examples/conf.apache22.yml ../examples/conf.apache24.yml ../etc/templates ../../ ../../etc ../../etc/conf.yml ../../examples/conf.nginx.yml ../../examples/conf.apache22.yml ../../examples/conf.apache24.yml ../../etc/templates /etc /etc/vhost-generator /etc/vhost-generator/conf.yml /etc/vhost-generator/templates)"
fuzzy

###
### Round 2 (Any Options)
###
declare -a args="(a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9)"
declare -a vals="(c p n t -c -p -n -t -h -v ./ ./etc ./etc/conf.yml ./examples/conf.nginx.yml ./examples/conf.apache22.yml ./examples/conf.apache24.yml ./etc/templates ../ ../etc ../etc/conf.yml ../examples/conf.nginx.yml ../examples/conf.apache22.yml ../examples/conf.apache24.yml ../etc/templates ../../ ../../etc ../../etc/conf.yml ../../examples/conf.nginx.yml ../../examples/conf.apache22.yml ../../examples/conf.apache24.yml ../../etc/templates /etc /etc/vhost-gen /etc/vhost-gen/conf.yml /etc/vhost-gen/templates)"
declare -a vals="(c p n t -c -p -n -t -h -v ./ ./etc ./etc/conf.yml ./examples/conf.nginx.yml ./examples/conf.apache22.yml ./examples/conf.apache24.yml ./etc/templates ../ ../etc ../etc/conf.yml ../examples/conf.nginx.yml ../examples/conf.apache22.yml ../examples/conf.apache24.yml ../etc/templates ../../ ../../etc ../../etc/conf.yml ../../examples/conf.nginx.yml ../../examples/conf.apache22.yml ../../examples/conf.apache24.yml ../../etc/templates /etc /etc/vhost-generator /etc/vhost-generator/conf.yml /etc/vhost-generator/templates)"
fuzzy
6 changes: 4 additions & 2 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
MIT License
# MIT License

Copyright (c) 2017 cytopia
**Copyright (c) 2017 [cytopia](https://github.com/cytopia)**

**Copyright (c) 2024 [bogny](https://github.com/bogny)**

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
24 changes: 12 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ endif

VERSION = 2.7
BINPATH = bin/
BINNAME = vhost-gen
BINNAME = vhost-generator

CONFIG = conf.yml
TPLDIR = templates
Expand Down Expand Up @@ -58,17 +58,17 @@ _lint-version:
@echo "# -------------------------------------------------------------------- #"
@echo "# Check version config"
@echo "# -------------------------------------------------------------------- #"
@VERSION_VHOSTGEN=$$( grep -E '^VERSION = "v?[.0-9]+(-\w+)?"' $(BINPATH)$(BINNAME) | awk -F'"' '{print $$2}' || true ); \
@VERSION_VHOSTGENERATOR=$$( grep -E '^VERSION = "v?[.0-9]+(-\w+)?"' $(BINPATH)$(BINNAME) | awk -F'"' '{print $$2}' || true ); \
VERSION_SETUP=$$( grep version= setup.py | awk -F'"' '{print $$2}' || true ); \
if [ "$${VERSION_VHOSTGEN}" != "$${VERSION_SETUP}" ]; then \
if [ "$${VERSION_VHOSTGENERATOR}" != "$${VERSION_SETUP}" ]; then \
echo "[ERROR] Version mismatch"; \
echo "bin/vhost-gen: $${VERSION_VHOSTGEN}"; \
echo "setup.py: $${VERSION_SETUP}"; \
echo "bin/vhost-generator: $${VERSION_VHOSTGENERATOR}"; \
echo "setup.py: $${VERSION_SETUP}"; \
exit 1; \
else \
echo "[OK] Version match"; \
echo "bin/vhost-gen: $${VERSION_VHOSTGEN}"; \
echo "setup.py: $${VERSION_SETUP}"; \
echo "bin/vhost-generator: $${VERSION_VHOSTGENERATOR}"; \
echo "setup.py: $${VERSION_SETUP}"; \
exit 0; \
fi \

Expand Down Expand Up @@ -231,21 +231,21 @@ install:
@echo "Installing files"
@echo ""
@# Create directories
mkdir -p /etc/vhost-gen
mkdir -p /etc/vhost-gen/templates
mkdir -p /etc/vhost-generator
mkdir -p /etc/vhost-generator/templates
@# Install binary
install -m 0755 $(BINPATH)/$(BINNAME) /usr/bin/$(BINNAME)
@# Install configs
install -m 0644 etc/$(CONFIG) /etc/vhost-gen/$(CONFIG)
install -m 0644 etc/$(TPLDIR)/*.yml /etc/vhost-gen/$(TPLDIR)
install -m 0644 etc/$(CONFIG) /etc/vhost-generator/$(CONFIG)
install -m 0644 etc/$(TPLDIR)/*.yml /etc/vhost-generator/$(TPLDIR)
@echo "Installation complete:"
@echo "----------------------------------------------------------------------"
@echo ""

uninstall:
@echo "Removing files"
@echo ""
rm -r /etc/vhost-gen
rm -r /etc/vhost-generator
rm /usr/bin/$(BINNAME)
@echo "Uninstallation complete:"
@echo "----------------------------------------------------------------------"
Expand Down
Loading

0 comments on commit 4571852

Please sign in to comment.