Skip to content

Commit

Permalink
feat: add task helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
steffans committed Jul 26, 2024
1 parent 84dbdbe commit 46431d5
Show file tree
Hide file tree
Showing 5 changed files with 1,601 additions and 150 deletions.
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
!/*.js
!/*.json
!/*.xml
!/*.yml
!/.github
!/src

Expand Down
36 changes: 36 additions & 0 deletions Taskfile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
version: '3'

env:
TASK_DIR: '{{.ROOT_DIR}}'
TASK_FILE: '{{.ROOT_TASKFILE}}'

tasks:
copy:
dir: '{{.TASKFILE_DIR}}'
env:
TASK_CWD: '{{.cwd}}'
cmds:
- composer run:task -q -- copy {{q .src}} {{q .dest}} {{if .ignore}}{{.ignore}}{{end}}
requires:
vars: [src, dest]
internal: true

placeholder:
dir: '{{.TASKFILE_DIR}}'
env:
TASK_CWD: '{{.cwd}}'
cmds:
- composer run:task -q -- placeholder {{q .src}} {{q (toRawJson .vars)}}
requires:
vars: [src, vars]
internal: true

zip:
dir: '{{.TASKFILE_DIR}}'
env:
TASK_CWD: '{{.cwd}}'
cmds:
- composer run:task -q -- zip {{q .src}} {{q .dest}} {{if .ignore}}{{.ignore}}{{end}}
requires:
vars: [src, dest]
internal: true
7 changes: 3 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,12 @@
}
},
"require-dev": {
"phpstan/phpstan": "^1.11",
"symfony/console": "^5.4.11 || ^6.0.11 || ^7.0",
"symfony/filesystem": "^5.4 || ^6.0 || ^7.0",
"symfony/finder": "^5.4 || ^6.0 || ^7.0"
"composer/composer": "^2.7",
"phpstan/phpstan": "^1.11"
},
"scripts": {
"phpstan": "phpstan analyse -c phpstan.neon",
"run:task": "YOOtheme\\Starter\\TaskHelper::run",
"create:element": "YOOtheme\\Starter\\CreateElementCommand"
}
}
Loading

0 comments on commit 46431d5

Please sign in to comment.