summaryrefslogblamecommitdiffhomepage
path: root/test/unit/check/node.py
blob: 6a3d581f5e4ce010a7b7a258624e0261df78b6d7 (plain) (tree)
1
2
3
4
5
6
7
8
9
         
                 
 
                              
 



                                                                     






                                                                         
                    
import os
import subprocess

from unit.option import option


def check_node():
    if not os.path.exists(f'{option.current_dir}/node/node_modules'):
        return False

    try:
        v_bytes = subprocess.check_output(['/usr/bin/env', 'node', '-v'])

        return [str(v_bytes, 'utf-8').lstrip('v').rstrip()]

    except subprocess.CalledProcessError:
        return False