Skip to content

Commit acd359f

Browse files
committed
chore: update commands for versioned docs
Signed-off-by: Terry Howe <[email protected]>
1 parent 7fc53b2 commit acd359f

File tree

257 files changed

+353
-153
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

257 files changed

+353
-153
lines changed

docs/commands/oras_resolve.mdx

+45

docusaurus.config.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ const config = {
5454
editUrl:
5555
"https://github.com/oras-project/oras-www/tree/main/",
5656
versions: {
57-
"1.1": {
58-
label: '1.1',
59-
path: '1.1',
57+
"1.2.0": {
58+
label: '1.2',
59+
path: '1.2',
6060
}
6161
}
6262
},

tools/install.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#!/usr/bin/env bash
22

3-
TEMPDIR="${1?First argument is temporary directory}"
3+
VERSION="${1?First argument is version to install}"
4+
TEMPDIR="${2?Second argument is temporary directory}"
45

5-
VERSION="1.1.0"
66
OS="$(uname -s | tr A-Z a-z)"
77
ARCH=$(test "$(uname -m)" = 'x86_64' && echo 'amd64' || echo 'arm64')
88

tools/refresh-commands.sh

+21-15
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
TEMPDIR=$(mktemp -d)
44
trap 'rm -rf "$TEMPDIR"' EXIT
5-
ORAS_COMMAND=$(./tools/install.sh ${TEMPDIR})
65

76
list_commands() {
87
STATE='Usage'
@@ -35,20 +34,27 @@ list_commands() {
3534
done
3635
}
3736

38-
WEIGHT=10
39-
list_commands | while read COMMAND
37+
VERSIONS=$(tr '[]",' ' ' <versions.json)
38+
for VERSION
39+
in ${VERSIONS}
4040
do
41-
RESULT=$(list_commands "${COMMAND}")
42-
if [ -z "${RESULT}" ]
43-
then
44-
./tools/parse.sh ${TEMPDIR} "${COMMAND}" $WEIGHT >docs/commands/oras_$COMMAND.mdx
45-
WEIGHT=$(expr $WEIGHT + 10)
46-
else
47-
for SUBCOMMAND
48-
in ${RESULT}
49-
do
50-
./tools/parse.sh ${TEMPDIR} "${COMMAND} ${SUBCOMMAND}" $WEIGHT >docs/commands/oras_${COMMAND}_${SUBCOMMAND}.mdx
41+
echo $VERSION
42+
ORAS_COMMAND=$(./tools/install.sh ${VERSION} ${TEMPDIR})
43+
WEIGHT=10
44+
list_commands | while read COMMAND
45+
do
46+
RESULT=$(list_commands "${COMMAND}")
47+
if [ -z "${RESULT}" ]
48+
then
49+
./tools/parse.sh ${TEMPDIR} "${COMMAND}" $WEIGHT >versioned_docs/version-${VERSION}/commands/oras_$COMMAND.mdx
5150
WEIGHT=$(expr $WEIGHT + 10)
52-
done
53-
fi
51+
else
52+
for SUBCOMMAND
53+
in ${RESULT}
54+
do
55+
./tools/parse.sh ${TEMPDIR} "${COMMAND} ${SUBCOMMAND}" $WEIGHT >docs/commands/oras_${COMMAND}_${SUBCOMMAND}.mdx
56+
WEIGHT=$(expr $WEIGHT + 10)
57+
done
58+
fi
59+
done
5460
done

versioned_docs/version-1.1/commands/oras_copy.mdx versioned_docs/version-1.1.0/commands/oras_cp.mdx

+7-8

versioned_docs/version-1.1/commands/oras_discover.mdx versioned_docs/version-1.1.0/commands/oras_discover.mdx

+1-1

versioned_docs/version-1.2/commands/oras_login.mdx versioned_docs/version-1.1.0/commands/oras_login.mdx

+1-1

versioned_docs/version-1.2/commands/oras_logout.mdx versioned_docs/version-1.1.0/commands/oras_logout.mdx

+1-1

versioned_docs/version-1.2/commands/oras_pull.mdx versioned_docs/version-1.1.0/commands/oras_pull.mdx

+1-1

versioned_docs/version-1.2/commands/oras_push.mdx versioned_docs/version-1.1.0/commands/oras_push.mdx

+1-1

versioned_docs/version-1.2/commands/oras_tag.mdx versioned_docs/version-1.1.0/commands/oras_tag.mdx

+1-1

versioned_docs/version-1.1/commands/oras_version.mdx versioned_docs/version-1.1.0/commands/oras_version.mdx

+1-1

0 commit comments

Comments
 (0)