How to use fire-path - 10 common examples

To help you get started, we’ve selected a few fire-path examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github tidys / CocosCreatorPlugins / packages / hot-update-tools / panel / index.js View on Github external
let emptyDir = function (fileUrl) {
                        let files = fs.readdirSync(fileUrl);//读取该文件夹
                        for (let k in files) {
                            let filePath = path.join(fileUrl, files[k]);
                            let stats = fs.statSync(filePath);
                            if (stats.isDirectory()) {
                                emptyDir(filePath);
                            } else {
                                fs.unlinkSync(filePath);
                                // self.addProgress();
                                // console.log("删除文件:" + filePath);
                            }
                        }
                    };
                    //删除所有的空文件夹
github HelloClouds / hot-update-tools-v2 / panel / index.js View on Github external
let emptyDir = function (fileUrl) {
                        let files = fs.readdirSync(fileUrl);//读取该文件夹
                        for (let k in files) {
                            let filePath = path.join(fileUrl, files[k]);
                            let stats = fs.statSync(filePath);
                            if (stats.isDirectory()) {
                                emptyDir(filePath);
                            } else {
                                fs.unlinkSync(filePath);
                                // self.addProgress();
                                // console.log("删除文件:" + filePath);
                            }
                        }
                    };
                    //删除所有的空文件夹
github tidys / CocosCreatorPlugins / packages / resize-image / panel / index.js View on Github external
_resizeImage(imgPath) {
                    if (!imgPath) {
                        this._addLog("图片路径有误: " + imgPath);
                        return;
                    }

                    let sharpPath = Editor.url('unpack://utils/sharp');
                    let sharp = require(sharpPath);

                    // 创建相应尺寸的目录
                    let desDir = this._getTempDir();
                    if (!fs.existsSync(desDir)) {
                        fs.mkdirSync(desDir);
                    }
                    let pixDir = path.join(desDir, this.sizeWidth + "x" + this.sizeHeight);
                    if (!fs.existsSync(pixDir)) {
                        fs.mkdirSync(pixDir);
                    }
                    let fileName = path.basename(imgPath);
                    let desFilePath = path.join(pixDir, fileName);

                    sharp(imgPath).resize(this.sizeWidth, this.sizeHeight).toFile(desFilePath, function (err, info) {
                        if (err) {
                            this._addLog("裁剪失败!" + imgPath);
                            // Editor.warn("error:"+err);
                            console.log("error:" + err);
                            console.log("info: " + info);
                        } else {
                            this._addLog("剪裁成功: " + imgPath);
                        }
                    }.bind(this));
github tidys / CocosCreatorPlugins / packages / hot-update-tools / panel / index.js View on Github external
_initLocalServerDir() {
                    if (this.localServerPath && this.localServerPath.length > 0) {
                        console.log("已经有本地server目录");
                    } else {
                        let zipDir = CfgUtil.getPackZipDir();
                        if (!fs.existsSync(zipDir)) {
                            fs.mkdirSync(zipDir);
                        }
                        let serverDir = path.join(zipDir, "server");
                        if (!fs.existsSync(serverDir)) {
                            fs.mkdirSync(serverDir);
                        }
                        this.localServerPath = serverDir;
                    }
                },
                // 选择项目的manifest文件目录
github tidys / CocosCreatorPlugins / packages / hot-update-tools / core / FileUtil.js View on Github external
let emptyDir = function (fileUrl) {
            let files = fs.readdirSync(fileUrl);//读取该文件夹
            for (let k in files) {
                let filePath = path.join(fileUrl, files[k]);
                let stats = fs.statSync(filePath);
                if (stats.isDirectory()) {
                    emptyDir(filePath);
                } else {
                    fs.unlinkSync(filePath);
                    console.log("删除文件:" + filePath);
                }
            }
        };
        //删除所有的空文件夹
github HelloClouds / hot-update-tools-v2 / panel / index.js View on Github external
_initLocalServerDir() {
                    if (this.localServerPath && this.localServerPath.length > 0) {
                        console.log("已经有本地server目录");
                    } else {
                        let zipDir = CfgUtil.getPackZipDir();
                        if (!fs.existsSync(zipDir)) {
                            fs.mkdirSync(zipDir);
                        }
                        let serverDir = path.join(zipDir, "server");
                        if (!fs.existsSync(serverDir)) {
                            fs.mkdirSync(serverDir);
                        }
                        this.localServerPath = serverDir;
                    }
                },
github Tasarinan / editor-framework / core / protocol-init.js View on Github external
return function ( urlInfo ) {
        if ( urlInfo.pathname ) {
            return Path.join( base, urlInfo.host, urlInfo.pathname );
        }
        return Path.join( base, urlInfo.host );
    };
}
github Tasarinan / editor-framework / page / editor-init.js View on Github external
var _urlToPath = function ( base, urlInfo ) {
    if ( urlInfo.pathname ) {
        return Path.join( base, urlInfo.host, urlInfo.pathname );
    }
    return Path.join( base, urlInfo.host );
};
github matchvs / OneTwoStep / packages / plugin-matchvs / panel / index.js View on Github external
files.forEach(function(filename){
                                if(filename.indexOf("vcxproj") !== -1 && filename.indexOf("vcxproj.") === -1) {
                                    projectConfigFilePath = PATH.join(projectConfigFileDir, filename);
                                    step4();
                                }
                                return;
                            });
                            return;
github xiaocongcc / GameFramework / packages / ui-creator / core / ui-template.js View on Github external
dealFolder(assetInfo) {
        let url = assetInfo.url;
        if (!fs.existsSync(outputFullPath)) {
            fs.mkdirsSync(outputFullPath);
        }
        let moduleName = path.basenameNoExt(url);
        let moduleFolder = path.join(outputFullPath, moduleName);
        if (!fs.existsSync(moduleFolder)) {
            fs.mkdirsSync(moduleFolder);
        }
    },

fire-path

A template to create node-module in fireball.

MIT
Latest version published 8 years ago

Package Health Score

42 / 100
Full package analysis

Popular fire-path functions

Similar packages