From 5d9b538513802964d5313ffe27336cab3b7471b7 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Tue, 20 Jan 2015 14:39:14 -0800 Subject: [PATCH] Add script to dump information for atom-shell --- script/dump_info.js | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 script/dump_info.js diff --git a/script/dump_info.js b/script/dump_info.js new file mode 100644 index 00000000..c95dd736 --- /dev/null +++ b/script/dump_info.js @@ -0,0 +1,39 @@ +var app = require('app'); + +function getDate() { + var today = new Date(); + var year = today.getFullYear(); + var month = today.getMonth() + 1; + if (month <= 9) + month = '0' + month; + var day= today.getDate(); + if (day <= 9) + day = '0' + day; + return year + '-' + month + '-' + day; +} + +app.on('ready', function() { + var json = {}; + json.version = process.versions['atom-shell']; + json.date = getDate(); + + var names = ['v8', 'uv', 'zlib', 'openssl', 'modules', 'chrome'] + for (var i in names) { + var name = names[i]; + json[name] = process.versions[name]; + } + + json.files = [ + 'darwin-x64', + 'darwin-x64-symbols', + 'linux-ia32', + 'linux-ia32-symbols', + 'linux-x64', + 'linux-x64-symbols', + 'win32-ia32', + 'win32-ia32-symbols', + ]; + + console.log(json); + process.exit(0); +}); -- 2.43.0