version = 0.1
default-task = 'start'

extensions = ['chomp@0.1:prettier']

[[task]]
name = 'start'
env = { TZ = 'UTC', NODE_ENV = 'development' }
deps = ['unit-tests']
run = """
node \
  --trace-warnings \
  bin/mnemosyne.js \
    --throttle-downloads 16777216 \
    --key 3569bdd87dbbbf73bd06cdbda35a2e773325acd027c6304c37eda5b1783097ea \
    --login localdev \
    --login username \
    --login username2 \
    --volume ./test-mnts \
    --volume ./test-mnts/mnt1 \
    --volume ./test-mnts/mnt2 \
    --permission localdev:./test-mnts \
    --permission username:./test-mnts \
    --permission username2:./test-mnts/mnt2
"""

[[task]]
name = 'unit-tests'
deps = ['src/**/*.js']
run = "mocha 'src/**/*.test.js'"

[[task]]
name = 'test'
deps = ['src/**/*test.js', 'test/**/*test.js']
run = "mocha 'src/**/*.test.js' 'test/**/*.test.js'"

[[task]]
name = 'lint'
run = "eslint ."

[[task]]
name = 'prettier'
template = 'prettier'
[task.template-options]
ignore-path = '.prettierignore'
files = 'bin/mnemosyne.js package.json src/**/*.@(js|json|yml) ./*.@(js|json|yml|md) ./.github/**/*.@(js|json|yml) ./deploy/**/*.@(js|json|yml)'
loglevel = 'warn'
config = '.prettierrc'

[[task]]
name = 'reset'
run = """
find . \
  -name node_modules \
  -type d \
  -exec rm -rv {} +
find . \
  -name package-lock.json \
  -type f \
  -delete
"""
