#!/usr/bin/env bash # builds the dev center documentation to /tmp/heroku-cli-commands.md set +x PACKAGE_VERSION=`node -e "console.log(require('./package.json').version)"` if [[ "${PACKAGE_VERSION}" == *"-"* ]]; then echo "Not on stable release, skipping devcenter docs update" exit fi cat << EOF > ~/.netrc machine api.heroku.com login heroku-cli@salesforce.com password $HEROKU_DEVCENTER_API_KEY EOF chmod 0600 ~/.netrc set -ex export PATH="./node_modules/.bin:./bin:$PATH" export COLUMNS=80 run whoami cat < README.md --- title: Heroku CLI Commands id: 4088 These are the help texts for each of the core Heroku CLI commands. You can also see this text in your terminal with \`heroku help\`, \`heroku --help\`, or \`heroku -h\`. EOF oclif readme --no-aliases # The final `sed` rewrites the link content itself so the published article # contains a working URL — it is NOT just cosmetic. @oclif/plugin-search tags # releases without a leading "v" but ships no `oclif.repositoryPrefix`, so oclif # defaults to `blob/v` and generates a 404 "See code" link # (…/plugin-search/blob/v1.2.38/… → should be …/blob/1.2.38/…). We strip the stray # "v" for plugin-search links only, before the push, so no broken link ever reaches # Dev Center. Note: this is a targeted patch for plugin-search — a different plugin # with the same no-"v"-tag-without-repositoryPrefix bug would slip through until this # rewrite is extended. Remove once the upstream plugin sets `oclif.repositoryPrefix` # (https://github.com/oclif/plugin-search). grep -v "^\\* \\[\`" README.md | grep -v "^