0.9.5 • Published 3 years ago

anyone-validate-fs v0.9.5

Weekly downloads
2
License
GPL-3.0-or-later
Repository
github
Last release
3 years ago

anyone-validate-fs

nightly-build action-build Release Build Node.js Package License Scanning

FOSSA Status dependencies Status devDependencies Status

version packagephobia packagephobia license

Build Status XO code style Total alerts Language grade: JavaScript DeepScan grade

This github action help you to validate file structure as you expected. The validate rule will follow the brace-expansion. For more official definition, please reference 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 actions modules are on the way. Please donate to me. I accept part time job contract. if you need, please contact me: zhang_nan_163@163.com

Inputs

brace-expansion

Required brace-expansion of expected directory structure.

ignore-files

the files you want to ignore. split with comma.

ignore-directories

the directories you want to ignore. split with comma.

read-path

the path that you assign to read.

render-layout

render diff result with \'vertical\' or \'horizontal\'

Outputs

output

output of execution.

Other way usage

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:
const {avfs} = require('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);
  return resolve.diff;
}, error => {
  if (error.name && error.message) {
    console.error(`error message: ${error.message}`);
  }

  return error.message;
});

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

uses: anyone-developer/anyone-validate-fs@v1.0
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

FOSSA Status

Donation

PalPal: https://paypal.me/nzhang4

0.9.4

3 years ago

0.9.5

3 years ago

0.9.2

3 years ago

0.9.1

3 years ago

0.9.0

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago