Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions hack/gen-api-reference-docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

set -euo pipefail

SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
Expand All @@ -25,19 +26,19 @@ REFDOCS_REPO="https://${REFDOCS_PKG}.git"
REFDOCS_VER="5c208a6"

KNATIVE_SERVING_REPO="github.com/knative/serving"
KNATIVE_SERVING_COMMIT="v0.2.3"
KNATIVE_SERVING_COMMIT="${KNATIVE_SERVING_COMMIT:?specify the \$KNATIVE_SERVING_COMMIT variable}"
KNATIVE_SERVING_OUT_FILE="serving.md"

KNATIVE_BUILD_REPO="github.com/knative/build"
KNATIVE_BUILD_COMMIT="v0.2.0"
KNATIVE_BUILD_COMMIT="${KNATIVE_BUILD_COMMIT:?specify the \$KNATIVE_BUILD_COMMIT variable}"
KNATIVE_BUILD_OUT_FILE="build.md"

KNATIVE_EVENTING_REPO="github.com/knative/eventing"
KNATIVE_EVENTING_COMMIT="v0.2.1"
KNATIVE_EVENTING_COMMIT="${KNATIVE_EVENTING_COMMIT:?specify the \$KNATIVE_EVENTING_COMMIT variable}"
KNATIVE_EVENTING_OUT_FILE="eventing/eventing.md"

KNATIVE_EVENTING_SOURCES_REPO="github.com/knative/eventing-sources"
KNATIVE_EVENTING_SOURCES_COMMIT="v0.2.1"
KNATIVE_EVENTING_SOURCES_COMMIT="${KNATIVE_EVENTING_SOURCES_COMMIT:?specify the \$KNATIVE_EVENTING_SOURCES_COMMIT variable}"
KNATIVE_EVENTING_SOURCES_OUT_FILE="eventing/eventing-sources.md"

log() {
Expand Down Expand Up @@ -163,6 +164,8 @@ main() {
log "Copy the files in reference/ directory to knative/docs."
if command -v open >/dev/null; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if command -v open >/dev/null; then
if command -v xdg-open >/dev/null; then

open "${clone_root}/out/"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
open "${clone_root}/out/"
xdg-open "${clone_root}/out/"

elif command -v xdg-open >/dev/null; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This failed for me on Linux. I searched and found this on stackoverflow:
[On linux] "The open command is a link to the openvt command and opens a binary in a new virtual console." which is not what we want and why the conditional does not fail.

I tried swapping the commands so that 'xdg-open' is tried/run first, before 'open', and it worked. But since I dont have my Mac setup right now to test the script, i've only just tired running 'xdg-open', which results in "-bash: xdg-open: command not found" (so I think we should be okay?).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
elif command -v xdg-open >/dev/null; then
elif command -v open >/dev/null; then

xdg-open "${clone_root}/out/"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
xdg-open "${clone_root}/out/"
open "${clone_root}/out/"

fi
}

Expand Down