forked from receter/my-component-library
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Taskfile.yaml
19 lines (17 loc) · 841 Bytes
/
Taskfile.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
version: '3'
tasks:
new-component:
desc: Create a new component
cmds:
- echo "Creating a new component {{ .CLI_ARGS }}"
- |
bash -c '
read -p "Enter component name: " component_name && \
fzf_path=$(find ./lib -type d | fzf) && \
mkdir -p "${fzf_path}/${component_name}" && \
cp etc/templates/NewComponent.stories.tsx "${fzf_path}/${component_name}/$(echo ${component_name^}).stories.tsx" && \
cp etc/templates/NewComponent.tsx "${fzf_path}/${component_name}/$(echo ${component_name^}).tsx" && \
echo "Component created at ${fzf_path}/${component_name}" && \
echo "Selected component type: ${fzf_path}"
code ${fzf_path}/${component_name}/$(echo ${component_name^}).tsx
code ${fzf_path}/${component_name}/$(echo ${component_name^}).stories.tsx'