cli.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:Mocha 作者: mardix 项目源码 文件源码
def _npm_install_static():
    print("NPM Install packages...")
    static_path = os.path.join(CWD, "application/static")
    package_json = os.path.join(static_path, "package.json")

    try:
        if os.path.isfile(package_json):
            with sh.pushd(static_path):
                sh.npm("install", "-f")
        else:
            print("**ERROR: Can't install static files, `package.json` is missing at `%s`" % package_json)
            print("*" * 80)
    except sh.CommandNotFound as e:
        print("")
        print("*** Error Command Not Found: `{0}` is not found. You need to install `{0}` to continue".format(str(e)))
        print("*" * 80)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号