Every line of 'download angular.min.js' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.
30 function jcl_download(cb) { 31 console.log('Downloading the Java class library (big download, may take a while)'); 32 process.chdir('vendor'); 33 // Ubuntu (security) repo actual on 24.02.2013 34 exec('mktemp -d jdk-download.XXX', function(err, stdout, stderr){ 35 DOWNLOAD_DIR = stdout.trim(); 36 process.chdir(DOWNLOAD_DIR); 37 var DEBS_DOMAIN="http://security.ubuntu.com/ubuntu/pool/main/o/openjdk-6"; 38 var DEBS = [ 39 "openjdk-6-jre-headless_6b27-1.12.6-1ubuntu0.12.04.4_i386.deb", 40 "openjdk-6-jdk_6b27-1.12.6-1ubuntu0.12.04.4_i386.deb", 41 "openjdk-6-jre-lib_6b27-1.12.6-1ubuntu0.12.04.4_all.deb" 42 ]; 43 var request = require('request'); 44 async.each(DEBS, function(deb, cb2){ 45 var url = DEBS_DOMAIN + '/' + deb; 46 var file = fs.createWriteStream(deb); 47 request(url).pipe(file); 48 file.on('finish', function(){ 49 file.close(); 50 exec('ar p '+deb+' data.tar.gz | tar zx', function(err, stdout, stderr){ 51 return cb2(err); 52 }); 53 }); 54 }, function(err){ 55 process.chdir('..'); 56 return cb(err); 57 }); 58 }); 59 }
6 function download(callback) { 7 if (fs.existsSync(binaryPath)) { 8 return process.nextTick(callback); 9 } 10 11 moz.download( 12 'firefox', 13 binaryPath, 14 function(err, path) { 15 if (err) throw err; 16 callback(); 17 } 18 ); 19 }
166 download() { 167 const files = osFilterObj(this.src() || []); 168 const urls = []; 169 170 if (files.length === 0) { 171 return Promise.reject(new Error('No binary found matching your system. It\'s probably not supported.')); 172 } 173 174 files.forEach(file => urls.push(file.url)); 175 176 return Promise.all(urls.map(url => download(url, this.dest(), { 177 extract: true, 178 strip: this.options.strip 179 }))).then(result => { 180 const resultingFiles = flatten(result.map((item, index) => { 181 if (Array.isArray(item)) { 182 return item.map(file => file.path); 183 } 184 185 const parsedUrl = url.parse(files[index].url); 186 const parsedPath = path.parse(parsedUrl.pathname); 187 188 return parsedPath.base; 189 })); 190 191 return Promise.all(resultingFiles.map(fileName => { 192 return chmodAsync(path.join(this.dest(), fileName), 0o755); 193 })); 194 }); 195 }
20 function download(name) { 21 const url = downloadDescription[name]; 22 const targetFile = getTargetFileName(name); 23 24 return new Promise((resolve, reject) => { 25 console.log(chalk.cyan(`Downloading syntax ${name} ...`)); 26 console.log(chalk.cyan.dim(` ${url}`)); 27 28 request(url, {}, (err, response, body) => { 29 if (err) { 30 console.error(chalk.red(`Download failed! ${err.message}`)); 31 console.error(chalk.red(err.stack)); 32 return reject(err); 33 } 34 if (response.statusCode != 200) { 35 console.error(chalk.red(`Download failed! because the response code is not 200`)); 36 console.error(chalk.red(` actual: ${response.statusCode} ${response.statusMessage}`)); 37 return reject(new Error(`response code is not 200, but ${response.statusCode}`)); 38 } 39 40 if (body instanceof Buffer) 41 body = body.toString('utf8'); 42 console.log(chalk.green(`Download success! (length: ${body.length})`)); 43 44 writeFile(targetFile, name, body); 45 console.log(chalk.green(`Written to "${targetFile}" success!`)); 46 47 if (name == defaultSyntax) { 48 writeFile(defaultFileName, name, body); 49 console.log(chalk.green(`Written to "${defaultFileName}" success!`)); 50 } 51 return resolve(body); 52 }); 53 }); 54 }