Changeset - e7fd22ecf6f9
[Not reviewed]
stable
0 1 0
Mads Kiilerich (mads) - 5 years ago 2020-11-04 21:11:48
mads@kiilerich.com
front-end: use 'bin' path for node commands instead of '.bin'

license-checker is using relative paths for importing other modules - that
worked fine when .bin/license-checker was a symlink, but not on filesystems
without symlinks support:

internal/modules/cjs/loader.js:883
throw err;
^

Error: Cannot find module '../lib/index'
1 file changed with 2 insertions and 2 deletions:
0 comments (0 inline, 0 general)
kallithea/bin/kallithea_cli_front_end.py
Show inline comments
 
@@ -54,13 +54,13 @@ def front_end_build(install_deps, genera
 
        with open(os.path.join(tmp_dir, 'pygments.css'), 'w') as f:
 
            subprocess.check_call(['pygmentize',
 
                    '-S', 'default',
 
                    '-f', 'html',
 
                    '-a', '.code-highlight'],
 
                    stdout=f)
 
        lesscpath = os.path.join(front_end_dir, 'node_modules', '.bin', 'lessc')
 
        lesscpath = os.path.join(front_end_dir, 'node_modules', 'less', 'bin', 'lessc')
 
        lesspath = os.path.join(front_end_dir, 'main.less')
 
        csspath = os.path.join(public_dir, 'css', 'style.css')
 
        subprocess.check_call([lesscpath, '--source-map',
 
                '--source-map-less-inline', lesspath, csspath],
 
                cwd=front_end_dir, shell=kallithea.is_windows)
 

	
 
@@ -88,13 +88,13 @@ def front_end_build(install_deps, genera
 
        click.echo("Preparing CodeMirror JS")
 
        if os.path.isdir(os.path.join(public_dir, 'codemirror')):
 
            shutil.rmtree(os.path.join(public_dir, 'codemirror'))
 
        shutil.copytree(os.path.join(front_end_dir, 'node_modules', 'codemirror'), os.path.join(public_dir, 'codemirror'))
 

	
 
        click.echo("Generating LICENSES.txt")
 
        license_checker_path = os.path.join(front_end_dir, 'node_modules', '.bin', 'license-checker')
 
        license_checker_path = os.path.join(front_end_dir, 'node_modules', 'license-checker', 'bin', 'license-checker')
 
        check_licensing_json_path = os.path.join(tmp_dir, 'licensing.json')
 
        licensing_txt_path = os.path.join(public_dir, 'LICENSES.txt')
 
        subprocess.check_call([license_checker_path, '--json', '--out', check_licensing_json_path],
 
                cwd=front_end_dir, shell=kallithea.is_windows)
 
        with open(check_licensing_json_path) as jsonfile:
 
            rows = json.loads(jsonfile.read())
0 comments (0 inline, 0 general)