diff options
Diffstat (limited to 'pomu/util/fs.py')
-rw-r--r-- | pomu/util/fs.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/pomu/util/fs.py b/pomu/util/fs.py new file mode 100644 index 0000000..f5f448c --- /dev/null +++ b/pomu/util/fs.py @@ -0,0 +1,15 @@ +""" +Filesystem utils +""" +import os + +def strip_prefix(string, prefix): + """Returns a string, stripped from its prefix""" + if string.startswith(prefix): + return string[len(prefix):] + else + return string + +def remove_file(repo, dst): + repo.index.remove(dst) + os.remove(dst) |