A Python script to add or remove a file to empty directories so that various version control systems retain them.
This script recurses through the given directories (or the current directory, by default), finds the empty subdirectories, and adds a file in each. This is used to mark all existing empty subdirectories in a hierarchy to be kept from deletion, or for the sentinels to be used to insure the directories are added to a version control repository that does not normally retain empty directories (e.g., Mecurial, Git).
For help and usage information specify the --help
option on the command line:
keep-empty-dirs.py --help
Version 1.x of this script is compatible with Python 2 version 2.6 or greater. Tested on Python version 2.7.5 (Linux).
Version 2.x of this script is compatible with Python 3. Tested on Python version 3.3.2 (Windows).
Your mileage may vary.
In accordance with the original author's licensing, this is licensed under the GNU General Public License v2 (GPL v2). Please see the referenced web page, or the LICENSE
file contained in this repostiory.
This work is Copyright © Robert M Burkhead, 2013. Portions of this work are Copyright © Martin Blais, 2001-2008.
The script found in this repository has been MODIFIED from the original, begining in October 2013, by Robert Burkhead.
- Original Author: Martin Blais (b at furius dot ca)
- Original Copyright: Copyright © 2001-2008 Martin Blais. All Rights Reserved.
- Original License: This code is distributed under the GNU General Public License (assumed to be GPL v2)
- Original project page: http://furius.ca/pubcode/pub/conf/bin/keep-empty-dirs.html (archive)
- Original source: http://furius.ca/pubcode/pub/conf/bin/keep-empty-dirs (archive)