From 03954f778ec491fe5a4f8e42996e3edbe35554d9 Mon Sep 17 00:00:00 2001 From: JP Wesselink Date: Mon, 4 Sep 2017 12:07:56 +0200 Subject: tools, build: refactor macOS installer Creates macOS pkg installer by using `pkgbuild` and `productbuild`. Removes previous npm installation before installing npm. Packages carry correct version attributes. Support for intl installer features, defaults to `en`. Fancy formatted license. Renamed `osx` references to `macOS`. Optional installation of npm. PR-URL: https://github.com/nodejs/node/pull/15179 Fixes: https://github.com/nodejs/node/issues/15012 Refs: https://github.com/nodejs/node/pull/5656 Refs: https://github.com/nodejs/node/pull/2571 Refs: https://github.com/nodejs/node/pull/7097 Reviewed-By: Lance Ball Reviewed-By: Daijiro Wachi Reviewed-By: James M Snell Reviewed-By: Joyee Cheung --- tools/macos-installer/pkgbuild/npm/scripts/postinstall | 5 +++++ tools/macos-installer/pkgbuild/npm/scripts/preinstall | 5 +++++ 2 files changed, 10 insertions(+) create mode 100755 tools/macos-installer/pkgbuild/npm/scripts/postinstall create mode 100755 tools/macos-installer/pkgbuild/npm/scripts/preinstall (limited to 'tools/macos-installer/pkgbuild') diff --git a/tools/macos-installer/pkgbuild/npm/scripts/postinstall b/tools/macos-installer/pkgbuild/npm/scripts/postinstall new file mode 100755 index 0000000000..285ce81e58 --- /dev/null +++ b/tools/macos-installer/pkgbuild/npm/scripts/postinstall @@ -0,0 +1,5 @@ +#!/bin/sh + +cd /usr/local/bin || exit 1 +ln -sf ../lib/node_modules/npm/bin/npm-cli.js npm +ln -sf ../lib/node_modules/npm/bin/npx-cli.js npx diff --git a/tools/macos-installer/pkgbuild/npm/scripts/preinstall b/tools/macos-installer/pkgbuild/npm/scripts/preinstall new file mode 100755 index 0000000000..848da677b4 --- /dev/null +++ b/tools/macos-installer/pkgbuild/npm/scripts/preinstall @@ -0,0 +1,5 @@ +#!/bin/sh + +[[ -d /usr/local/lib/node_modules/npm ]] \ + && rm -rf /usr/local/lib/node_modules/npm +exit 0 -- cgit v1.2.3