Skip to content
This repository was archived by the owner on Mar 3, 2023. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jed/config-leaf
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: craftship/config-leaf
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Able to merge. These branches can be automatically merged.
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on May 24, 2017

  1. Copy the full SHA
    6c48b96 View commit details
Showing with 19 additions and 13 deletions.
  1. +19 −13 index.js
32 changes: 19 additions & 13 deletions index.js
Original file line number Diff line number Diff line change
@@ -8,24 +8,30 @@ module.exports = function(fn) {
var to = path.join(process.cwd(), process.argv[3]);

prompt.start();

prompt.get([
{
description: "Enter the config password (" + path.basename(to) + "):\n",
name: "password",
type: "string",
hidden: true,
replace: "*",
required: true
}
], function (err, result) {

var schema = {
description: "Enter the config password (" + path.basename(to) + "):\n",
name: "password",
type: "string",
hidden: true,
replace: "*",
required: false
};

var getSchema = [];

if (!process.env.CONFIG_LEAF_PASSWORD) {
getSchema.push(schema);
}

prompt.get(getSchema, function (err, result) {
if (err) {
console.log(err);
} else {
from = fs.createReadStream(from);
to = fs.createWriteStream(to);
fn = fn("cast5-cbc", result.password);
fn = fn("cast5-cbc", result.password || process.env.CONFIG_LEAF_PASSWORD);

from.pipe(fn).pipe(to);
from.on("end", function () {
console.log("done");