Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

npm.js 907B

1234567891011121314151617181920212223242526272829303132
  1. 'use strict';
  2. const path = require("path")
  3. const {debug} = require("../debug")
  4. const whichOrUndefined = require("../which-or-undefined")
  5. /**
  6. * Intercepts npm spawned processes.
  7. *
  8. * @param workingDir {string} Absolute system-dependent path to the directory containing the shim files.
  9. * @param options {import("../munge").InternalSpawnOptions} Original internal spawn options.
  10. * @return {import("../munge").InternalSpawnOptions} Updated internal spawn options.
  11. */
  12. function mungeNpm(workingDir, options) {
  13. debug('munge npm')
  14. // XXX weird effects of replacing a specific npm with a global one
  15. const npmPath = whichOrUndefined('npm')
  16. if (npmPath === undefined) {
  17. return {...options};
  18. }
  19. const newArgs = [...options.args]
  20. newArgs[0] = npmPath
  21. const file = path.join(workingDir, 'node')
  22. newArgs.unshift(file)
  23. return {...options, file, args: newArgs}
  24. }
  25. module.exports = mungeNpm