https://github.com/anyone-developer/anyone-validate-fs
This action helps you to validate the file structure as you expected. The validate rule will follow the brace-expansion.
https://github.com/anyone-developer/anyone-validate-fs
anyone-developer anyone-validate-fs github-actions
Last synced: about 1 year ago
JSON representation
This action helps you to validate the file structure as you expected. The validate rule will follow the brace-expansion.
- Host: GitHub
- URL: https://github.com/anyone-developer/anyone-validate-fs
- Owner: anyone-developer
- License: gpl-3.0
- Created: 2020-10-19T08:46:01.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2023-01-25T21:02:10.000Z (over 3 years ago)
- Last Synced: 2024-10-17T06:31:47.787Z (over 1 year ago)
- Topics: anyone-developer, anyone-validate-fs, github-actions
- Language: JavaScript
- Homepage:
- Size: 2.67 MB
- Stars: 1
- Watchers: 2
- Forks: 2
- Open Issues: 19
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
README
# anyone-validate-fs



[](https://app.fossa.com/projects/custom%2B21065%2Fgit%40github.com%3Aanyone-developer%2Fanyone-validate-fs.git?ref=badge_small)
[](https://github.com/anyone-developer/anyone-validate-fs/network/updates)


[](https://travis-ci.org/anyone-developer/anyone-validate-fs)
[](https://github.com/xojs/xo)
[](https://lgtm.com/projects/g/anyone-developer/anyone-validate-fs/alerts/)
[](https://lgtm.com/projects/g/anyone-developer/anyone-validate-fs/context:javascript)
[](https://deepscan.io/dashboard#view=project&tid=11532&pid=14440&bid=269275)
[](https://gitpod.io/#https://github.com/anyone-developer/anyone-validate-fs)
This GitHub action helps you to validate the file structure as you expected. The validate rule will follow the brace-expansion. For a more official definition, please refer to https://www.gnu.org/software/bash/manual/bash.html#Brace-Expansion
*If you like my module, please buy me a coffee.*
*More and more tiny and useful GitHub action modules are on the way. Please donate to me. I accept a part-time job contract. if you need, please contact me: zhang_nan_163@163.com*
## Inputs
### `brace-expansion`
**Required** brace-expansion of the expected directory structure.
### `ignore-files`
the files you want to ignore. split with a comma.
### `ignore-directories`
the directories you want to ignore. split with a comma.
### `read-path`
the path that you assign to read.
### `render-layout`
render diff result with \'vertical\' or \'horizontal\'
## Outputs
### `output`
the output of execution.
## Other way usages
### `From NPM for programmatic use`
- create a 'demo' folder
- **npm init** to create your nodejs package
- copy 'sample_folder' to demo
- **npm install anyone-validate-fs** to install module
- create 'index.js' and copy code below:
```javascript
const avfs = require('@anyone-developer/anyone-validate-fs');
avfs.setRenderLayout("horizontal").diff(
'./sample_folder',
'{x/p,y/f,{a,b/{ba1,ba2,bb1,bb2},c,d}/{a.qa.config,b.prd.config}}',
"README.md",
".git"
).then(resolve => {
console.info(resolve.diff);
}, error => {
if (error && error.diff) {
console.error(`${error.diff}`);
}
});
```
here is repl.it online editor: https://repl.it/@EdwardRoshan/anyone-validate-fs-demo
- **node index.js** to run it

### `From NPM for using as a command-line app`
- **npm install -g anyone-validate-fs** to install gobally
- **anyone-validate-fs -r './sample_folder' -b '{a,b/{ba1,ba2,bb1,bb2},c,d}/{a.qa.config,b.prd.config}' -I ".git" -i "README.md"** to use your bash to execute it.
- you would get same result with above screenshot
## Example usage
```yml
uses: anyone-developer/anyone-validate-fs@main
with:
brace-expansion: '{a,b/{ba1,ba2,bb1,bb2},c,d}/{a.qa.config,b.prd.config}'
ignore-files: 'README.md'
ignore-directories: '.git'
read-path: 'sample_folder'
render-layout: 'horizontal'
```
## Fossa Report
[](https://app.fossa.com/projects/custom%2B21065%2Fgit%40github.com%3Aanyone-developer%2Fanyone-validate-fs.git?ref=badge_large)
## Donation
PalPal: https://paypal.me/nzhang4

