file-not-empty

assert file exists and not empty


Keywords
assert exists, cli, shell
License
BSD-3-Clause
Install
pip install file-not-empty==0.0.1

Documentation

Travis

Install

$ [sudo] npm i -g file-not-empty
$ [sudo] pip install file-not-empty

Features

  • exit 0 if path exists, file and not empty
  • exit 1 if path not exists, not file or not empty

Usage

usage: file-not-empty path ...

Examples

$ file-not-empty "not-empty-file" "not-existing-file"
ERROR 'not-existing-file' NOT EXISTS
s1

$ file-not-empty "not-empty-file" "empty file"
ERROR 'not-empty-file' EMPTY
$ echo $?
1

$ file-not-empty "not-empty-file"
$ echo $?
0