Files
flipper/scripts/npm-publish.sh
Daniel Büchele f69bfab0f4 npm
Summary:
Publishing flipper to npm via Sandcastle.
- NPM token added to secrets tool
- removing private flag from package JSON
- adding publish script

Reviewed By: passy

Differential Revision: D16984934

fbshipit-source-id: 334991381d4035928af9a9d98d3905280938736a
2019-08-23 09:33:56 -07:00

20 lines
753 B
Bash
Executable File

#!/bin/bash
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the LICENSE file
# in the root directory of this source tree.
set -e
THIS_DIR=$(cd -P "$(dirname "$(readlink "${BASH_SOURCE[0]}" || echo "${BASH_SOURCE[0]}")")" && pwd)
cd "$THIS_DIR/.."
# remove scripts section from package.json, because we don't want post-install scripts executed for plugin developers
jq 'del(.scripts)' package.json > package2.json
rm package.json
mv package2.json package.json
echo "//registry.yarnpkg.com/:_authToken=$(secrets_tool get FLIPPER_NPM_TOKEN)" > ~/.npmrc
../third-party/yarn/yarn publish --proxy http://fwdproxy:8080 --https-proxy http://fwdproxy:8080 --new-version "$1"
rm -rf ~/.npmrc