diff --git a/Gruntfile.js b/Gruntfile.js index e1b5ead..dd11eed 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -1,7 +1,7 @@ var sqlite3 = require('sqlite3').verbose(); var dbName = 'nest.db'; -var serverLocation = 'ssh://localhost:9000'; +var serverLocation = 'ssh://'; module.exports = function ( grunt ) { require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks); @@ -137,4 +137,24 @@ module.exports = function ( grunt ) { console.log('\nShutting down...\n'); } }); -}; \ No newline at end of file + + grunt.registerTask('config', function(ip,port){ + var gruntTextReplace = require('grunt-text-replace/lib/grunt-text-replace'); + console.log(ip); + console.log(port); + gruntTextReplace.replace({ + src: ['Gruntfile.js', 'bowers-nest.js', 'templates/.bowerrc'], + overwrite: true, + replacements: [ + { + from://g, + to: ip + }, + { + from://g, + to: port + } + ] + }); + }); +}; diff --git a/README.md b/README.md index 477e337..763c1b2 100644 --- a/README.md +++ b/README.md @@ -33,8 +33,7 @@ Run tests and sync with official Bower repository Configure server location - gedit Gruntfile.js - gedit templates/.bowerrc + grunt config::port Configure SSH on your server @@ -61,7 +60,7 @@ Register package with name = unicorn To register package with name and URL, please use curl like so - curl http://localhost:9000/packages/ -v -F 'name=package1' -F 'url=http://repo1.git' + curl http://:/packages/ -v -F 'name=package1' -F 'url=http://repo1.git' Unregister package with name = unicorn @@ -96,10 +95,10 @@ Sync with official Bower registry packages ### Manual commands through curl: List packages, add package1 and package2, list package1, search for 1, remove one and list all - curl http://localhost:9000/packages/ - curl http://localhost:9000/packages/ -v -F 'name=package1' -F 'url=http://repo1.git' - curl http://localhost:9000/packages/ -v -F 'name=package2' -F 'url=http://repo2.git' - curl http://localhost:9000/packages/package1 - curl http://localhost:9000/packages/search/1 - curl -v -X DELETE localhost:9000/packages/package1 - curl http://localhost:9000/packages/ + curl http://:/packages/ + curl http://:/packages/ -v -F 'name=package1' -F 'url=http://repo1.git' + curl http://:/packages/ -v -F 'name=package2' -F 'url=http://repo2.git' + curl http://:/packages/package1 + curl http://:/packages/search/1 + curl -v -X DELETE :/packages/package1 + curl http://:/packages/ diff --git a/bower.json b/bower.json index 8de4aa6..41432c7 100644 --- a/bower.json +++ b/bower.json @@ -1,7 +1,7 @@ { "name": "bowers-nest", "main": "bowers-nest.js", - "version": "1.0.1", + "version": "1.0.0", "homepage": "https://github.com/presidenten/bowers-nest", "authors": [ "Johan Hernefeldt" diff --git a/bowers-nest.js b/bowers-nest.js index be8b8a1..34e8dd0 100644 --- a/bowers-nest.js +++ b/bowers-nest.js @@ -1,3 +1,5 @@ var server = require('./server/server'); -server.start(); +var port = ; + +server.start(port); diff --git a/package.json b/package.json index 3fff5eb..bc6240e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bowers-nest", - "version": "1.0.1", + "version": "1.0.0", "description": "A Bower registry written for node and express with SQLite3", "main": "server.js", "scripts": { @@ -31,6 +31,7 @@ "jasmine-node": "~1.11.0", "grunt-jasmine-node": "~0.1.0", "grunt-curl": "~1.1.1", - "grunt-contrib-clean": "~0.5.0" + "grunt-contrib-clean": "~0.5.0", + "grunt-text-replace": "~0.3.8" } } diff --git a/templates/.bowerrc b/templates/.bowerrc index 373c37a..1eff135 100644 --- a/templates/.bowerrc +++ b/templates/.bowerrc @@ -1,8 +1,8 @@ { - "directory": "bower_components", - "registry": "http://localhost:9000", - "registry.search": "http://localhost:9000", - "registry.register": "http://localhost:9000", - "registry.publish": "http://localhost:9000", - "proxy": "" -} \ No newline at end of file + "directory": "bower_components", + "registry": "http://:", + "registry.search": "http://:", + "registry.register": "http://:", + "registry.publish": "http://:", + "proxy": "" + } \ No newline at end of file