示例#1
0
文件: gitlab.js 项目: jiajianrong/jr8
        return new Promise(function(resolve, reject) {

            scaffold.download(self.address + '@' + self.version, function(error, location) {

                if (error) {
                    return reject(error);
                }

                self.convert(location);

                var target = path.join(factory.settings.componentsDir, self.name);
                var mapping = self.config.mapping || [];

                if (mapping.length) {
                    mapping.unshift({
                        reg: /^\/component.json$/i,
                        release: '$0'
                    });
                    mapping.push({
                        reg: '**',
                        release: false
                    });
                } else {
                    mapping.push({
                        reg: '*',
                        release: '$&'
                    });
                }
                scaffold.deliver(location, target, mapping);

                resolve(self);
            }, progress);
        });
示例#2
0
    return new Promise(function(resolve, reject) {
        scaffold.download(remote, function(error, location) {
            if (error) {
                return reject(error);
            }

            self.downloadDir = location;
            resolve();
        }, progress);
    });