UNPKG

stalker-apps-base

Version:

MAG Core Platform meta-package with all base applications.

80 lines (67 loc) 2.38 kB
#!/usr/bin/env node 'use strict'; var exec = require('child_process').exec, fs = require('fs'), version = '5.5.0'; exec('npm outdated', {cwd: process.cwd()}, function ( error, stdout, stderr ) { var packageJson = require('../package.json'), packages = stdout.split('\n'), order = [ 'magcore-app-tv', 'magcore-app-tv-classic', 'magcore-app-dvb', 'magcore-app-video-club', 'magcore-app-video-club-prime', 'magcore-app-radio', 'magcore-app-magic-cast', 'magcore-app-audio-club', 'magcore-app-explorer', 'magcore-app-records', 'magcore-app-weather', 'magcore-app-personal-account', 'magcore-app-settings', 'magcore-app-browser', 'magcore-app-downloads', 'magcore-app-karaoke', 'magcore-app-lines', 'magcore-app-sudoku', 'magcore-app-memory', 'magcore-app-2048' ]; packages.shift(); packages.pop(); packageJson.order = order; packages.forEach(function ( str ) { var module; str = str.replace(/( ){2,}/g, ' ').split(' '); module = { name: str[0], current: str[1], wanted: str[2], latest: str[3], location: str[4] }; packageJson.dependencies[module.name] = module.latest; console.log('update package ' + module.name + '@' + module.latest); }); packageJson.version = version + '-r' + (new Date()).toISOString().replace(/-|:|T|\...../g, ''); fs.writeFile('package.json', JSON.stringify(packageJson, null, 4), function ( error ) { if ( error ) { process.exit(1); } else { //console.log('unpublish'); //exec('npm unpublish -f', {cwd: process.cwd()}, function ( error ) { // if ( error ) { // process.exit(1); // } else { // //console.log('publish'); // //exec('npm publish', {cwd: process.cwd()}, function ( error ) { // // if ( error ) { // // process.exit(1); // // } // //}); // } //}); } }); });