diff --git a/tools/create_package.py b/tools/create_package.py index 8a0e59a..a00fea7 100644 --- a/tools/create_package.py +++ b/tools/create_package.py @@ -29,7 +29,7 @@ def CompressFiles (inputFiles, outputFile): for inputFile in inputFiles: extension = os.path.splitext (inputFile)[1] if extension == '.js': - parameters.append ('--js=' + os.path.join ('..', inputFile)) + parameters.append ('--js=' + inputFile) parameters.append ('--js_output_file=' + outputFile) result = Tools.RunCommand ('google-closure-compiler', parameters) if result != 0: @@ -119,11 +119,10 @@ def CreatePackage (rootDir, websiteDir, packageDir, version): return True def Main (argv): - currentDir = os.path.dirname (os.path.abspath (__file__)) - os.chdir (currentDir) + toolsDir = os.path.dirname (os.path.abspath (__file__)) + rootDir = os.path.dirname (toolsDir) + os.chdir (rootDir) - rootDir = os.path.abspath ('..') - testBuild = False buildDir = os.path.join (rootDir, 'build', 'final') if len (argv) >= 2 and argv[1] == 'test': @@ -137,7 +136,7 @@ def Main (argv): shutil.rmtree (buildDir) config = None - with open ('config.json') as configJson: + with open (os.path.join (toolsDir, 'config.json')) as configJson: config = json.load (configJson) PrintInfo ('ESLint importer sources.') diff --git a/tools/optimize_svg_files.py b/tools/optimize_svg_files.py index 33b653a..8f4bc0d 100644 --- a/tools/optimize_svg_files.py +++ b/tools/optimize_svg_files.py @@ -4,9 +4,10 @@ import sys from lib import tools_lib as Tools def Main (argv): - currentDir = os.path.dirname (os.path.abspath (__file__)) - os.chdir (currentDir) - imagesPath = os.path.abspath (os.path.join ('..', 'website', 'assets', 'images')) + 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 diff --git a/tools/update_includes.py b/tools/update_includes.py index f123a7f..435b124 100644 --- a/tools/update_includes.py +++ b/tools/update_includes.py @@ -11,14 +11,14 @@ def PrintError (message): print ('ERROR: ' + message) def Main (argv): - currentDir = os.path.dirname (os.path.abspath (__file__)) - os.chdir (currentDir) + toolsDir = os.path.dirname (os.path.abspath (__file__)) + rootDir = os.path.dirname (toolsDir) + os.chdir (rootDir) config = None - with open ('config.json') as configJson: + with open (os.path.join (toolsDir, 'config.json')) as configJson: config = json.load (configJson) - rootDir = os.path.abspath ('..') websiteFiles = [ os.path.join ('website', 'index.html'), os.path.join ('website', 'embed.html')