From beb4696b23f0f08efca1d262a29b4c518738468f Mon Sep 17 00:00:00 2001 From: Mathias Buus Date: Mon, 20 Oct 2014 13:17:38 +0900 Subject: [PATCH] first commit --- npm/.gitignore | 5 +++++ npm/README.md | 8 ++++++++ npm/darwin.sh | 2 ++ npm/install.js | 21 +++++++++++++++++++++ npm/package.json | 19 +++++++++++++++++++ 5 files changed, 55 insertions(+) create mode 100644 npm/.gitignore create mode 100644 npm/README.md create mode 100755 npm/darwin.sh create mode 100755 npm/install.js create mode 100644 npm/package.json diff --git a/npm/.gitignore b/npm/.gitignore new file mode 100644 index 000000000000..fdd90df813f3 --- /dev/null +++ b/npm/.gitignore @@ -0,0 +1,5 @@ +node_modules +*.zip +darwin/ +win32/ +linux/ \ No newline at end of file diff --git a/npm/README.md b/npm/README.md new file mode 100644 index 000000000000..64993685d5b1 --- /dev/null +++ b/npm/README.md @@ -0,0 +1,8 @@ +# atom-shell + +Install [atom-shell](https://github.com/atom/atom-shell) prebuilts using npm + +``` +npm install -g atom-shell +atom-shell # will open atom shell +``` \ No newline at end of file diff --git a/npm/darwin.sh b/npm/darwin.sh new file mode 100755 index 000000000000..7c88674c0266 --- /dev/null +++ b/npm/darwin.sh @@ -0,0 +1,2 @@ +#!/bin/bash +./darwin/Atom.app/Contents/MacOS/Atom \ No newline at end of file diff --git a/npm/install.js b/npm/install.js new file mode 100755 index 000000000000..99a18947b932 --- /dev/null +++ b/npm/install.js @@ -0,0 +1,21 @@ +#!/usr/bin/env node + +var os = require('os') +var path = require('path') +var nugget = require('nugget') +var extract = require('extract-zip') + +var version = '0.18.0' +var name = version+'-atom-shell.zip' +var url = 'https://github.com/atom/atom-shell/releases/download/v'+version+'/atom-shell-v'+version+'-'+os.platform()+'-'+os.arch()+'.zip' + +var onerror = function(err) { + throw err +} + +nugget(url, {target:name, dir:__dirname, resume:true}, function(err) { + if (err) return onerror(err) + extract(path.join(__dirname, name), {dir:path.join(__dirname, os.platform())}, function(err) { + if (err) return onerror(err) + }) +}) diff --git a/npm/package.json b/npm/package.json new file mode 100644 index 000000000000..2b0cf0419c44 --- /dev/null +++ b/npm/package.json @@ -0,0 +1,19 @@ +{ + "name": "atom-shell", + "version": "1.0.0", + "description": "Install atom-shell prebuilts using npm", + "scripts": { + "install": "./install.js" + }, + "bin": { + "atom-shell": "./darwin.sh" + }, + "main": "install.js", + "dependencies": { + "extract-zip": "^1.0.3", + "nugget": "^1.1.2" + }, + "devDependencies": {}, + "author": "Mathias Buus", + "license": "MIT" +}