2016-05-30 00:28:47 +00:00
|
|
|
import "typings-global";
|
|
|
|
import * as plugins from "./npmci.plugins";
|
2016-05-30 01:40:07 +00:00
|
|
|
import {bash} from "./npmci.bash";
|
2016-05-30 00:28:47 +00:00
|
|
|
|
2016-05-29 20:54:59 +00:00
|
|
|
let npmrcPrefix:string = "//registry.npmjs.org/:_authToken=";
|
2016-05-30 00:28:47 +00:00
|
|
|
let npmToken:string = process.env.NPMCITOKEN;
|
|
|
|
let npmrcFileString = npmrcPrefix + npmToken;
|
|
|
|
|
2016-05-29 20:54:59 +00:00
|
|
|
|
|
|
|
export let publish = () => {
|
2016-05-30 00:28:47 +00:00
|
|
|
let done = plugins.q.defer();
|
2016-05-30 01:06:18 +00:00
|
|
|
plugins.beautylog.ok("Tests passed, now publishing to npm!");
|
2016-05-30 02:44:13 +00:00
|
|
|
plugins.smartfile.memory.toFsSync(npmrcFileString,{fileName:"npmrc",filePath:"/etc/"});
|
2016-05-30 01:40:07 +00:00
|
|
|
bash("npm publish");
|
2016-05-30 01:06:18 +00:00
|
|
|
plugins.beautylog.ok("Done!")
|
2016-05-30 00:28:47 +00:00
|
|
|
return done.promise;
|
2016-05-29 20:54:59 +00:00
|
|
|
};
|