Skip to content
Permalink
Browse files

Minor improvement on cleaning script

  • Loading branch information...
gtozzi committed Feb 24, 2016
1 parent ec7abcd commit 3257469b8cd7d324ec9dd551872f26503c5f7edc
Showing with 18 additions and 2 deletions.
  1. +3 −1 README.md
  2. +15 −1 clean.py
@@ -93,6 +93,8 @@ Keep in mind that even when set this way, the option will be saved in the `CMake

You can now use the classic *make* command to compile the POL. You can type:
* `make` or `make all` to do the build
* `make clean` to delete all the intermediate build files

You will find the compiled files inside the `bin/` folder.

To delete intermediate build files and clean the folder you can use the
interective clean.py script.
@@ -89,6 +89,17 @@ def findBinaries(self):
def clearBinaries(self):
self.__delFromList(self.findBinaries())

def findEmpty(self):
''' Returns list of empty folders '''
ret = []
for folder, subfolders, files in os.walk(self.root):
if not subfolders and not files:
ret.append(os.path.join(self.root,folder))
return ret

def clearEmpty(self):
self.__delFromList(self.findEmpty())


if __name__ == '__main__':
import argparse
@@ -130,9 +141,12 @@ def yesNo(question, default=None):
if c.findCmake() and yesNo('Delete cmake and intermediate build files?', True):
c.clearCmake()

if c.findBinaries() and yesNo('Delete built finaries?', True):
if c.findBinaries() and yesNo('Delete built binaries?', True):
c.clearBinaries()

if c.findEmpty() and yesNo('Delete empty folders?', True):
c.clearEmpty()

if yesNo('Show list of files ignored by git?', False):
c = ['git', 'ls-files', '--others', '-i', '--exclude-standard']
subprocess.call(c)

0 comments on commit 3257469

Please sign in to comment.
You can’t perform that action at this time.