def Main(argv): toolsDir = os.path.dirname(os.path.abspath(__file__)) rootDir = os.path.dirname(toolsDir) os.chdir(rootDir) imagesPath = os.path.abspath(os.path.join('website', 'assets', 'images')) Tools.RunCommand('svgo', ['-r', imagesPath]) return 0
def Main(argv): currentDir = os.path.dirname(os.path.abspath(__file__)) os.chdir(currentDir) imagesPath = os.path.abspath( os.path.join('..', 'website', 'assets', 'images')) for i in range(0, 5): Tools.RunCommand(['svgo', '-r', imagesPath]) return 0
def CompressFiles(inputFiles, outputFile): parameters = [] for inputFile in inputFiles: extension = os.path.splitext(inputFile)[1] if extension == '.js': parameters.append('--js=' + inputFile) parameters.append('--js_output_file=' + outputFile) result = Tools.RunCommand('google-closure-compiler', parameters) if result != 0: return False return True
def ESLintFolder(folder): result = Tools.RunCommand('eslint', [folder]) if result != 0: return False return True
def JSHintFolder(folder): result = Tools.RunCommand(['jshint', folder]) if result != 0: return False return True