Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Components - Filesystem #2659

Merged
merged 2 commits into from
Nov 27, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions components/filesystem/get_file/component.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Get file
description: Get file from directory.
inputs:
- {name: Directory, type: Directory}
- {name: Subpath, type: String}
outputs:
- {name: File}
implementation:
container:
image: alpine
command:
- sh
- -ex
- -c
- |
mkdir -p "$(dirname "$2")"
cp -r "$0/$1" "$2"
- inputPath: Directory
- inputValue: Subpath
- outputPath: File
20 changes: 20 additions & 0 deletions components/filesystem/get_subdirectory/component.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Get subdirectory
description: Get subdirectory from directory.
inputs:
- {name: Directory, type: Directory}
- {name: Subpath, type: String}
outputs:
- {name: Subdir, type: Directory}
implementation:
container:
image: alpine
command:
- sh
- -ex
- -c
- |
mkdir -p "$(dirname "$2")"
cp -r "$0/$1" "$2"
- inputPath: Directory
- inputValue: Subpath
- outputPath: Subdir
19 changes: 19 additions & 0 deletions components/filesystem/list_items/component.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: List items
description: Recursively list directory contents.
inputs:
- {name: Directory, type: Directory}
outputs:
- {name: Items}
implementation:
container:
image: alpine
command:
- sh
- -ex
- -c
- |
mkdir -p "$(dirname "$1")"
#ls --almost-all --recursive "$0" > "$1"
ls -A -R "$0" > "$1"
- inputPath: Directory
- outputPath: Items