mirror of
https://github.com/chromebrew/chromebrew.git
synced 2026-01-10 07:57:59 -05:00
Make the repo look like a mess
This commit is contained in:
@@ -12,4 +12,4 @@ Installation
|
||||
|
||||
Download and run installation script
|
||||
|
||||
wget -q -O - https://raw.github.com/skycocker/chromebrew/master/install_chromebrew.sh | sudo bash
|
||||
wget -q -O - https://raw.github.com/skycocker/chromebrew/master/install.sh | sudo bash
|
||||
|
||||
28
cbrew.coffee
Normal file
28
cbrew.coffee
Normal file
@@ -0,0 +1,28 @@
|
||||
program = require 'commander'
|
||||
fs = require 'fs'
|
||||
events = require 'events'
|
||||
global.eventDispatch = new events.EventEmitter
|
||||
|
||||
program.version '0.0.1'
|
||||
program.parse process.argv
|
||||
|
||||
action = process.argv[2]
|
||||
pkgName = process.argv[3]
|
||||
|
||||
search = (pkgName, callback) ->
|
||||
fs.readdir '.', (err, files) =>
|
||||
callback file for file in files when file.indexOf(pkgName) isnt -1
|
||||
|
||||
download = (pkgName) ->
|
||||
pkg = require './' + pkgName + '.coffee'
|
||||
pkg.getBinary()
|
||||
|
||||
install = (pkgName) ->
|
||||
download pkgName
|
||||
eventDispatch.on 'gotFile', ->
|
||||
console.log "installing..."
|
||||
|
||||
switch action
|
||||
when "search" then search pkgName, console.log
|
||||
when "download" then download pkgName
|
||||
when "install" then install pkgName
|
||||
17
formulas/binutils.coffee
Normal file
17
formulas/binutils.coffee
Normal file
@@ -0,0 +1,17 @@
|
||||
network = require './network.coffee'
|
||||
|
||||
module.exports =
|
||||
binary_url: "https://dl.dropboxusercontent.com/s/u3cp7mpdyfx99ij/binutils-2.23.2-chromeos-i686.tar.gz?token_hash=AAGsFB9HXNb5tSAm_Wd2GyIUL59BkZYgMTHkj4CkHLxggg&dl=1"
|
||||
binary_sha1: ""
|
||||
|
||||
binary_install: ->
|
||||
|
||||
getBinary: ->
|
||||
network.getFile @binary_url
|
||||
|
||||
build: ->
|
||||
system './configure'
|
||||
system 'make'
|
||||
|
||||
install: ->
|
||||
system 'make install'
|
||||
8
formulas/mpfr.coffee
Normal file
8
formulas/mpfr.coffee
Normal file
@@ -0,0 +1,8 @@
|
||||
network = require './network.coffee'
|
||||
|
||||
module.exports =
|
||||
binary_url: "https://dl.dropboxusercontent.com/s/lo9ks3g7ar3zpfu/mpfr-3.1.2-chromeos-i686.tar.gz?token_hash=AAH1GlLfYtUs4uxl1ayeGTBe8RJ5uTXzOAsXgSlv8G5rrA&dl=1"
|
||||
binary_sha1: ""
|
||||
|
||||
getBinary: (callback) ->
|
||||
network.getFile @binary_url
|
||||
24
network.coffee
Normal file
24
network.coffee
Normal file
@@ -0,0 +1,24 @@
|
||||
https = require 'https'
|
||||
progressbar = require 'progress'
|
||||
fs = require 'fs'
|
||||
|
||||
module.exports.getFile = (url) ->
|
||||
https.get url, (res) ->
|
||||
len = parseInt res.headers['content-length'], 10
|
||||
content_disposition = res.headers['content-disposition']
|
||||
filename = content_disposition.substring content_disposition.indexOf('"')+1, content_disposition.length-1
|
||||
|
||||
console.log();
|
||||
bar = new progressbar ' downloading [:bar] :percent :etas', {
|
||||
complete: '='
|
||||
incomplete: ' '
|
||||
width: 20
|
||||
total: len
|
||||
}
|
||||
|
||||
res.on 'data', (chunk) ->
|
||||
fs.appendFileSync filename, chunk
|
||||
bar.tick chunk.length
|
||||
|
||||
res.on 'end', ->
|
||||
eventDispatch.emit 'gotFile'
|
||||
Reference in New Issue
Block a user