Skip to content

Commit

Permalink
feat: inform of install type
Browse files Browse the repository at this point in the history
  • Loading branch information
medikoo committed Nov 9, 2018
1 parent 6c2069b commit c2bdf25
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions lib/install-package.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
"use strict";

const { resolve } = require("path")
, rmdir = require("fs2/rmdir")
, log = require("log4").get("dev-package")
, ee = require("event-emitter")
, isPackageLinked = require("./is-package-linked")
, runProgram = require("./run-program")
, setupRepository = require("./setup-repository")
, setupNpmLink = require("./setup-npm-link");
const { resolve } = require("path")
, rmdir = require("fs2/rmdir")
, log = require("log4").get("dev-package")
, ee = require("event-emitter")
, cleanupNpmInstall = require("./cleanup-npm-install")
, isPackageLinked = require("./is-package-linked")
, isDirectory = require("./is-directory")
, runProgram = require("./run-program")
, setupRepository = require("./setup-repository")
, setupNpmLink = require("./setup-npm-link");

const ongoingMap = new Map();
const done = new Set();
Expand Down Expand Up @@ -54,7 +56,11 @@ const setupDependencies = async (packageName, { packagesPath, packagesMeta, hook
module.exports = ee(async (packageName, { packagesPath, packagesMeta, hooks }) => {
const packagePath = resolve(packagesPath, packageName);

module.exports.emit("start", { packageName });
module.exports.emit("start", {
packageName,
type: (await isDirectory(packagePath)) ? "update" : "install"
});

const pendingJobs = [];
ongoingMap.set(packageName, pendingJobs);

Expand Down

0 comments on commit c2bdf25

Please sign in to comment.