Skip to content

Commit

Permalink
chore: include comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesgeorge007 committed Jun 29, 2019
1 parent 0d9aa9a commit 941da90
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/serve/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,15 @@ const pmConfig: PackageManagerConfig = {
};

const spawnWithArg = (pm: string, cmd: string): SpawnSyncReturns<Buffer> => {
/*
* The dependency installation commands for the
* respective package manager is available as
* nested objects within pmConfig
*
* We gonna extract the root installation command
* and rest of the flags from pmConfig object
* by means of array destructuring
*/
const [installCmd, ...flags] = pmConfig[pm][cmd];
const options: string[] = [installCmd, "webpack-dev-server", ...flags];
return spawn.sync(pm, options, { stdio: "inherit" });
Expand Down

0 comments on commit 941da90

Please sign in to comment.