https://github.com/agilecreativity/dir-archiver
Archive directories having specific depth from a given directory
https://github.com/agilecreativity/dir-archiver
Last synced: about 1 year ago
JSON representation
Archive directories having specific depth from a given directory
- Host: GitHub
- URL: https://github.com/agilecreativity/dir-archiver
- Owner: agilecreativity
- License: mit
- Created: 2016-04-05T11:22:57.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2016-06-12T02:13:55.000Z (about 10 years ago)
- Last Synced: 2025-06-15T11:57:21.369Z (about 1 year ago)
- Language: Ruby
- Size: 10.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
## Directory Archiver (dir-archiver)
Archive directory having the given depth from a given directory.
TL;DR: `dir-archiver --input-dir ~/projects --depth 2 --sep "__" -output-dir ~/archives --commit`
[][gem]
[][gemnasium]
[gem]: http://badge.fury.io/rb/dir-archiver
[gemnasium]: https://gemnasium.com/agilecreativity/dir-archiver
### Installation
```sh
# Install the gem
gem install dir-archiver
# refresh your gem just in case
rbenv rehash
# Get list of options just type the name of the gem
github_archiver
```
You should see something like
```
Usage: dir-archiver [options]
Specific options:
-i, --input-dir INPUT_DIR where INPUT_DIR is starting directory
If not specified, current directory will be used
-d, --depth NUMBER where NUMBER is depth of the directory from the starting directory
If not specified, 1 will be used
-s, --seperator [SEP] The seperator string to be used
If not specified, '__' will be used
-o, --output-dir OUTPUT_DIR where OUTPUT_DIR is output directory
If not specified, current directory will be used
-c, --[no-]commit Commit your action
default to --no-commit e.g. dry-run only
Common options:
-h, --help Show this message
Example Usage:
a) archive all immediate directories from the given directory (default to 1 level)
$cd ~/inputs/projects
$dir-archiver --commit
b) archive all directory 2 level depth (dry-run)
$dir-archiver -i ~/inputs/projects -d 2 -s '__' -o ~/outputs/archives
c) archive all directory 2 level depth (commit action)
$dir-archiver -i ~/inputs/projects -d 2 -s '__' -o ~/outputs/archives
```
### Contributing
1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request
[Thor]: https://github.com/erikhuda/thor
[Minitest]: https://github.com/seattlerb/minitest
[RSpec]: https://github.com/rspec
[Guard]: https://github.com/guard/guard
[Yard]: https://github.com/lsegal/yard
[Pry]: https://github.com/pry/pry
[Rubocop]: https://github.com/bbatsov/rubocop