Verified Commit 99660c55 authored by CompileNix's avatar CompileNix

add build scripts

parent f2858c3a
......@@ -2,3 +2,5 @@
*.txt
*.swp
/config.js
./fnm
/dist
MIT License
Copyright (c) 2019 Compilenix
Copyright (c) 2019 CompileNix
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
......
......@@ -5,10 +5,22 @@ https://www.paypal.me/compilenix
```sh
git clone https://git.compilenix.org/Compilenix/web-access_log2email.git
cd web-access_log2email
npm ci --production
./buildDist.sh --production
cd dist
cp config.example.js config.js
$EDITOR config.js # make your changes
node index.js
unzip -ou node.zip >/dev/null
unzip -ou node_modules.zip >/dev/null
rm -v node.zip node_modules.zip
./node/bin/node index.js
```
## Profit!
# Development
```sh
git clone https://git.compilenix.org/Compilenix/web-access_log2email.git
cd web-access_log2email
. ./build.sh
cp config.example.js config.js
$EDITOR config.js # make your changes
node index.js
```
#!/bin/zsh
set -x
set +e
rm -rf node_modules .fnm dist
set -e
curl -fsSL https://github.com/Schniz/fnm/raw/master/.ci/install.sh | bash -s -- --install-dir "./.fnm" --skip-shell
PATH="$(pwd)/.fnm:$PATH"
eval "`fnm env --multi`"
fnm install
fnm use
case "$1" in
"--production"|"--release")
npm ci --production
;;
"--development"|"--debug"|*)
npm ci
;;
esac
npm run-script test
set +x
#!/bin/zsh
. ./build.sh "$1"
nodePath=$(dirname $(which node))
mkdir -pv dist
cp -v *.js *.service README.md LICENSE dist/
rm -v dist/MessageTemplateExpressions.js
cp -r "${nodePath}/.." ./node
zip -r dist/node_modules.zip node_modules
zip -r dist/node.zip ./node
rm -r ./node
set +x
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment