function archive() {
  let outputZip = fs.createWriteStream(__dirname + "/example.zip");
  let archiveZip = archiver("zip", {
    gzip: true
  });
  outputZip.on("close", function() {
    console.log(archiveZip.pointer() + " total bytes");
    console.log(
      "archiver has been finalized and the output file descriptor has closed."
    );
  });
  archiveZip.on("error", function(err) {
    throw err;
  });
  archiveZip.pipe(outputZip);
  archiveZip.directory(dist, "test2");
  archiveZip.finalize();

  let outputTar = fs.createWriteStream(__dirname + "/example.tgz");
  let archiveTar = archiver("tar", {
    gzip: true
  });
  outputTar.on("close", function() {
    return gulp.src(archiveTar).pipe(onSuccess("Archive Complete: Tar, /dist"));
  });
  archiveTar.on("error", function(err) {
    throw err;
  });
  archiveTar.pipe(outputTar);
  archiveTar.directory(dist, "test2");
  archiveTar.finalize();
}
/*";
let fontSrcFolder = app + "fonts/*.*";
let cxSrcFiles = app + "includes/browser_action/*.*";
let cxBackgroundFile = app + "includes/background/*.*";
let jsonFile = app + "*.json";
let jQueryFile = app + "scripts/staticJS/jquery-1.12.3.min.js";
let bin = app + "/bin/*";
let staticJSSrcFile = js_destFolderStatic + js_destFileStatic;
let readMe = "./README.md";

gulp.task("copy", ["staticJS"], function() {
  gulp
    .src(imgSrcFolder)
    .pipe(gulp.dest(dist + "images"))
    .pipe(gulp.dest(dist_CX + "images"));

  gulp
    .src(fontSrcFolder)
    .pipe(gulp.dest(dist + "fonts"))
    .pipe(gulp.dest(dist_CX + "fonts"));

  gulp
    .src(staticJSSrcFile)
    .pipe(gulp.dest(dist + "js"))
    .pipe(gulp.dest(dist_CX + "js"));

  gulp
    .src(jQueryFile)
    .pipe(gulp.dest(dist + "js"))
    .pipe(gulp.dest(dist_CX + "js"));

  gulp
    .src(jsonFile)
    .pipe(gulp.dest(dist))
    .pipe(gulp.dest(dist_CX));

  gulp.src(readMe).pipe(gulp.dest(dist));

  gulp.src(cxBackgroundFile).pipe(gulp.dest(dist_CX + "background"));

  gulp.src(bin).pipe(gulp.dest(dist + "bin"));

  return gulp
    .src(cxSrcFiles)
    .pipe(gulp.dest(dist_CX + "browser_action"))

    .pipe(notify(onSuccess(" Copy ")));
});

// Clean files that get compiled but shouldn't
gulp.task("clean", function() {
  return gulp
    .src(
      [
        dist_CX + "images/fav/manifest.json",
        dist_CX + "embedded.html",
        dist_CX + "index.html",
        dist_CX + "signmsg.html",
        dist + "cx-wallet.html",
        dist + "images/icons",
        dist + "manifest.json",
        dist_CX + "package.json"
      ],
      { read: false }
    )
    .pipe(plumber({ errorHandler: onError }))
    .pipe(clean())
    .pipe(notify(onSuccess(" Clean ")));
});

// Bumps Version Number
function bumpFunc(t) {
  return gulp
    .src([app + "*.json"])
    .pipe(plumber({ errorHandler: onError }))
    .pipe(bump({ type: t }))
    .pipe(gulp.dest("./app"))
    .pipe(notify(onSuccess("Bump " + t)));
}

// Get Version Number
let versionNum;
let versionMsg;
gulp.task("getVersion", function() {
  manifest = JSON.parse(fs.readFileSync(app + "manifest.json"));
  versionNum = "v" + manifest.version;
  versionMsg = "Release: " + versionNum;
  //return gulp.src( './' )
  //.pipe( notify ( onSuccess('Version Number ' + versionNum ) ))
});

// zips dist folder
gulp.task("zip", ["getVersion"], function() {
  gulp
    .src(dist + "*