Skip to content

Commit 296a204

Browse files
committed
feat:compress subdirectories under folder workflow
1 parent d9eb966 commit 296a204

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
name: Use zip to compress all subdirectories under a folder and output each directory as a zip file.
3+
command: "for dir in $(ls -d {{directory}}*/); do (zip -r -q {{output}}$(basename $dir){{zip_name_endwith}}.zip $dir && echo -e \"Compressed to {{output}}$(basename $dir){{zip_name_endwith}}.zip.\"); done"
4+
tags:
5+
- zip
6+
description: Use zip to compress all subdirectories under a folder and output each directory as a zip file.
7+
arguments:
8+
- name: directory
9+
description: The directory to execute.
10+
default_value: ./
11+
- name: output
12+
description: The output directory of the zip file. Optional, defaults to the current directory.
13+
default_value: ./
14+
- name: zip_name_endwith
15+
description: Endwith string of each zip file name Optional, the default time string.
16+
default_value: _$(date +%Y%m%d%H%M%S)
17+
source_url: "https://linuxhint.com/what-is-zip-file/"
18+
author: funnyzak
19+
author_url: "https://github.com/funnyzak"
20+
shells:
21+
- Bash

0 commit comments

Comments
 (0)