#! /usr/bin/python

import json 
import os
import sys
import subprocess
import time
import re
import shutil
from sys import exit

print('CMake Project Cleaner')
buildpath = "build-%s" % sys.platform

def isCmakeToolsProject():
    if(os.path.exists('.cmake-project.json')):
        os.rename('.cmake-project.json', 'cmake-project.json')
    if(os.path.exists('cmake-project.json')):
        return True
    return False

def loadProject():
    if(isCmakeToolsProject()):
        with open('cmake-project.json') as json_file:
            return json.load(json_file)

    return None

def clear(names):

    for name in names:

        if name == "all":
            shutil.rmtree(buildpath, ignore_errors=True)
            return True

        path = buildpath + "/src/exe/%s" % name
        if not os.path.exists(path):
            path = buildpath + "/src/lib/%s" % name
            if not os.path.exists(path):
                continue

        shutil.rmtree(path, ignore_errors=True)
    
    return True

project = loadProject()
if project == None:
    print('No project found')
    exit()

names = ["all"]
if len(sys.argv) > 1:
    names = sys.argv[1:]

print("\033[1;34mCleaning: %s\033[0;0m" % names)
ret = clear(names)

if ret == False:
    print('Failed to clean the project')
7d44c059f3af06ba4c8da9a9bc2a07a9dc1a48f0
<mask token>


def isCmakeToolsProject():
    if os.path.exists('.cmake-project.json'):
        os.rename('.cmake-project.json', 'cmake-project.json')
    if os.path.exists('cmake-project.json'):
        return True
    return False


def loadProject():
    if isCmakeToolsProject():
        with open('cmake-project.json') as json_file:
            return json.load(json_file)
    return None


def clear(names):
    for name in names:
        if name == 'all':
            shutil.rmtree(buildpath, ignore_errors=True)
            return True
        path = buildpath + '/src/exe/%s' % name
        if not os.path.exists(path):
            path = buildpath + '/src/lib/%s' % name
            if not os.path.exists(path):
                continue
        shutil.rmtree(path, ignore_errors=True)
    return True


<mask token>

<mask token>
print('CMake Project Cleaner')
<mask token>


def isCmakeToolsProject():
    if os.path.exists('.cmake-project.json'):
        os.rename('.cmake-project.json', 'cmake-project.json')
    if os.path.exists('cmake-project.json'):
        return True
    return False


def loadProject():
    if isCmakeToolsProject():
        with open('cmake-project.json') as json_file:
            return json.load(json_file)
    return None


def clear(names):
    for name in names:
        if name == 'all':
            shutil.rmtree(buildpath, ignore_errors=True)
            return True
        path = buildpath + '/src/exe/%s' % name
        if not os.path.exists(path):
            path = buildpath + '/src/lib/%s' % name
            if not os.path.exists(path):
                continue
        shutil.rmtree(path, ignore_errors=True)
    return True


<mask token>
if project == None:
    print('No project found')
    exit()
<mask token>
if len(sys.argv) > 1:
    names = sys.argv[1:]
print('\x1b[1;34mCleaning: %s\x1b[0;0m' % names)
<mask token>
if ret == False:
    print('Failed to clean the project')

<mask token>
print('CMake Project Cleaner')
buildpath = 'build-%s' % sys.platform


def isCmakeToolsProject():
    if os.path.exists('.cmake-project.json'):
        os.rename('.cmake-project.json', 'cmake-project.json')
    if os.path.exists('cmake-project.json'):
        return True
    return False


def loadProject():
    if isCmakeToolsProject():
        with open('cmake-project.json') as json_file:
            return json.load(json_file)
    return None


def clear(names):
    for name in names:
        if name == 'all':
            shutil.rmtree(buildpath, ignore_errors=True)
            return True
        path = buildpath + '/src/exe/%s' % name
        if not os.path.exists(path):
            path = buildpath + '/src/lib/%s' % name
            if not os.path.exists(path):
                continue
        shutil.rmtree(path, ignore_errors=True)
    return True


project = loadProject()
if project == None:
    print('No project found')
    exit()
names = ['all']
if len(sys.argv) > 1:
    names = sys.argv[1:]
print('\x1b[1;34mCleaning: %s\x1b[0;0m' % names)
ret = clear(names)
if ret == False:
    print('Failed to clean the project')

import json
import os
import sys
import subprocess
import time
import re
import shutil
from sys import exit
print('CMake Project Cleaner')
buildpath = 'build-%s' % sys.platform


def isCmakeToolsProject():
    if os.path.exists('.cmake-project.json'):
        os.rename('.cmake-project.json', 'cmake-project.json')
    if os.path.exists('cmake-project.json'):
        return True
    return False


def loadProject():
    if isCmakeToolsProject():
        with open('cmake-project.json') as json_file:
            return json.load(json_file)
    return None


def clear(names):
    for name in names:
        if name == 'all':
            shutil.rmtree(buildpath, ignore_errors=True)
            return True
        path = buildpath + '/src/exe/%s' % name
        if not os.path.exists(path):
            path = buildpath + '/src/lib/%s' % name
            if not os.path.exists(path):
                continue
        shutil.rmtree(path, ignore_errors=True)
    return True


project = loadProject()
if project == None:
    print('No project found')
    exit()
names = ['all']
if len(sys.argv) > 1:
    names = sys.argv[1:]
print('\x1b[1;34mCleaning: %s\x1b[0;0m' % names)
ret = clear(names)
if ret == False:
    print('Failed to clean the project')

#! /usr/bin/python

import json 
import os
import sys
import subprocess
import time
import re
import shutil
from sys import exit

print('CMake Project Cleaner')
buildpath = "build-%s" % sys.platform

def isCmakeToolsProject():
    if(os.path.exists('.cmake-project.json')):
        os.rename('.cmake-project.json', 'cmake-project.json')
    if(os.path.exists('cmake-project.json')):
        return True
    return False

def loadProject():
    if(isCmakeToolsProject()):
        with open('cmake-project.json') as json_file:
            return json.load(json_file)

    return None

def clear(names):

    for name in names:

        if name == "all":
            shutil.rmtree(buildpath, ignore_errors=True)
            return True

        path = buildpath + "/src/exe/%s" % name
        if not os.path.exists(path):
            path = buildpath + "/src/lib/%s" % name
            if not os.path.exists(path):
                continue

        shutil.rmtree(path, ignore_errors=True)
    
    return True

project = loadProject()
if project == None:
    print('No project found')
    exit()

names = ["all"]
if len(sys.argv) > 1:
    names = sys.argv[1:]

print("\033[1;34mCleaning: %s\033[0;0m" % names)
ret = clear(names)

if ret == False:
    print('Failed to clean the project')