diff --git a/.circleci/base_config.yml b/.circleci/base_config.yml index f42c581ce7..d0377e7916 100644 --- a/.circleci/base_config.yml +++ b/.circleci/base_config.yml @@ -426,7 +426,7 @@ jobs: - "28:4f:0b:b7:71:cd:39:ab:c0:33:65:4f:da:6a:cc:8e" - "bc:4d:f3:df:53:ad:22:d8:60:5d:10:d8:fd:74:d2:cd" - attach_workspace: - at: . + at: /tmp - run: ssh-keyscan github.com >> ~/.ssh/known_hosts && cat ~/.ssh/known_hosts - clone-docs-and-merge diff --git a/.circleci/generate_config.py b/.circleci/generate_config.py index 472fbe15b7..abad791280 100644 --- a/.circleci/generate_config.py +++ b/.circleci/generate_config.py @@ -280,7 +280,9 @@ def workflow_generate_launch_command(config): export HUGO_URL=https://<< pipeline.parameters.deploy-url >>--docs-hugo.netlify.app\n \ export HUGO_ENV=examples\n \ export OVERRIDE=<< pipeline.parameters.override >>\n \ -export GENERATORS='<< parameters.generators >>'\n" +: > /home/circleci/project/docs-hugo/toolchain/docker/config.yaml\n \ +echo 'generators: << parameters.generators >>' >> /home/circleci/project/docs-hugo/toolchain/docker/config.yaml\n\ +echo 'servers:' >> /home/circleci/project/docs-hugo/toolchain/docker/config.yaml" for i in range(len(versions)): version = versions[i]["name"] @@ -296,8 +298,9 @@ def workflow_generate_launch_command(config): version_underscore = version.replace(".", "_") branchEnv = f"{pullImage}\n \ -export ARANGODB_BRANCH_{version_underscore}={branch}\n \ -export ARANGODB_SRC_{version_underscore}=/home/circleci/project/{version}" +echo ' \"{version}\": \"{branch}\"' >> /home/circleci/project/docs-hugo/toolchain/docker/config.yaml\n\ +mkdir -p /tmp/arangodb\n\ +mv /tmp/{version} /tmp/arangodb/" shell = f"{shell}\n{branchEnv}" @@ -371,14 +374,18 @@ def workflow_release_launch_command(config): export ENV=\"circleci\"\n \ export HUGO_URL=https://docs.arangodb.com\n \ export HUGO_ENV=release\n \ -export GENERATORS=''\n" +: > /home/circleci/project/docs-hugo/toolchain/docker/config.yaml\n \ +echo 'generators: \"\"' >> /home/circleci/project/docs-hugo/toolchain/docker/config.yaml\n\ +echo 'servers:' >> /home/circleci/project/docs-hugo/toolchain/docker/config.yaml" pullImage = pullImageCmd(args.arangodb_branch, args.docs_version) version_underscore = args.docs_version.replace(".", "_") branchEnv = f"{pullImage}\n \ -export ARANGODB_BRANCH_{version_underscore}={args.arangodb_branch}\n \ -export ARANGODB_SRC_{version_underscore}=/home/circleci/project/{args.docs_version}" +echo ' \"{args.docs_version}\": \"{args.arangodb_branch}\"' >> /home/circleci/project/docs-hugo/toolchain/docker/config.yaml\n\ +mkdir -p /tmp/arangodb\n\ +mv /tmp/{args.docs_version} /tmp/arangodb/" + shell = f"{shell}\n{branchEnv}" @@ -402,7 +409,7 @@ def pullImageCmd(branch, version): version={version}\n" pullImage += "\ image_name=$(echo ${BRANCH##*/})\n\ -main_hash=$(awk 'END{print}' $version/.git/logs/HEAD | awk '{print $2}' | cut -c1-9)\n\ +main_hash=$(awk 'END{print}' /tmp/$version/.git/logs/HEAD | awk '{print $2}' | cut -c1-9)\n\ docker pull arangodb/docs-hugo:$image_name-$version-$main_hash\n\ docker tag arangodb/docs-hugo:$image_name-$version-$main_hash $image_name-$version" diff --git a/README.md b/README.md index 09a7da8bd9..dad2b8e0d7 100644 --- a/README.md +++ b/README.md @@ -183,10 +183,9 @@ The toolchain container needs to be set up via config file in `toolchain/docker/ ```yaml generators: # Generators to trigger - empty string defaults to all generators -servers: # Array to define arangodb servers to be used by the toolchain - - image: # arangodb docker image to be used, can be arangodb/enterprise-preview:... or a branch name - version: # docs branch to put the generated content into - - ... # Additional images and versions as needed +servers: # define arangodb servers to be used by the toolchain + "{docs-version}": "{arangodb-branch}" # version folder of the documentation to put the generated content into: arangodb docker image to be used, can be arangodb/enterprise-preview:... or a branch name + ... ``` **Available generators** @@ -204,15 +203,13 @@ If `metrics` or `error-codes` is in the `generators` string, the following environment variable has to be exported: ```shell -export ARANGODB_SRC_{VERSION}=path/to/arangodb/source +export ARANGODB_SRC=path/to/arangodb/source ``` -Substitute `{VERSION}` with a version number like `3_11`. - On Windows using PowerShell, use a Unix-like path: ```powershell -$Env:ARANGODB_SRC_3_11 = "/Drive/path/to/arangodb" +$Env:ARANGODB_SRC = "/Drive/path/to/arangodb" ``` **Configuration example** @@ -220,10 +217,8 @@ $Env:ARANGODB_SRC_3_11 = "/Drive/path/to/arangodb" ```yaml generators: examples oasisctl options optimizer servers: - - image: arangodb/enterprise-preview:3.11-nightly - version: "3.11" - - image: arangodb/enterprise-preview:devel-nightly - version: "3.12" + "3.11": "arangodb/enterprise-preview:3.11-nightly" + "3.12": "arangodb/enterprise-preview:devel-nightly" ``` **Run the toolchain** @@ -895,60 +890,7 @@ It makes a warning show at the top of every page for that version. + --arangodb-branches << pipeline.parameters.arangodb-3_11 >> << pipeline.parameters.arangodb-3_12 >> << pipeline.parameters.arangodb-4_0 >> \ ``` -3. In the `toolchain/docker/amd64/docker-compose.yml` file, add an entry under - `services.toolchain.volumes` for the new version. Simply increment the value - after `:-/tmp/`. Example: - - ```diff - - ${ARANGODB_SRC_3_12:-/tmp/2}:/tmp/3.12 - + - ${ARANGODB_SRC_4_0:-/tmp/3}:/tmp/4.0 - ``` - - Under `services.toolchain.environment`, you need to add two different entries - for the new version. Example: - - ```diff - ARANGODB_SRC_3_11: ${ARANGODB_SRC_3_11} - ARANGODB_SRC_3_12: ${ARANGODB_SRC_3_12} - + ARANGODB_SRC_4_0: ${ARANGODB_SRC_4_0} - ARANGODB_BRANCH_3_11: ${ARANGODB_BRANCH_3_11} - ARANGODB_BRANCH_3_12: ${ARANGODB_BRANCH_3_12} - + ARANGODB_BRANCH_4_0: ${ARANGODB_BRANCH_4_0} - ``` - - The same changes are required in the - `toolchain/docker/arm64/docker-compose.yml` file. - -4. In the `toolchain/docker/config.yaml` file, add an entry for the new version. - Example: - - ```diff - - image: ${ARANGODB_BRANCH_3_12_IMAGE} - version: ${ARANGODB_BRANCH_3_12_VERSION} - + - + - image: ${ARANGODB_BRANCH_4_0_IMAGE} - + version: ${ARANGODB_BRANCH_4_0_VERSION} - ``` - -5. In the `toolchain/scripts/toolchain.sh` file, find the code that accesses - environment variables with the format `$ARANGODB_BRANCH_X_XX` where `X_XX` - is a version number like `3_12`, so `$ARANGODB_BRANCH_3_12` for instance. - Duplicate the block of an existing version and adjust all version numbers. - Example: - - ```diff - if [ "$ARANGODB_BRANCH_3_12" != "" ] ; then - export ARANGODB_BRANCH_3_12_IMAGE="$ARANGODB_BRANCH_3_12" - export ARANGODB_BRANCH_3_12_VERSION="3.12" - fi - - +if [ "$ARANGODB_BRANCH_4_0" != "" ] ; then - + export ARANGODB_BRANCH_4_0_IMAGE="$ARANGODB_BRANCH_4_0" - + export ARANGODB_BRANCH_4_0_VERSION="4.0" - +fi - ``` - -6. In the `site/data` folder, create a new folder with the short version number +3. In the `site/data` folder, create a new folder with the short version number as the name, e.g. `4.0`. In the new `site/data/4.0` folder, create a `cache.json` file with the following content: @@ -958,7 +900,7 @@ It makes a warning show at the top of every page for that version. Add this untracked file to Git! -7. Duplicate the folder of the most recent version in `site/content`, e.g. +4. Duplicate the folder of the most recent version in `site/content`, e.g. the `3.12` folder, and rename the copy to the new version, e.g. `4.0`. The `menuTitle` in the front matter of the version homepage, e.g. @@ -1001,7 +943,7 @@ It makes a warning show at the top of every page for that version. Add the new, untracked files to Git! -8. In the `PULL_REQUEST_TEMPLATE.md` file, add a new line for the new version. +5. In the `PULL_REQUEST_TEMPLATE.md` file, add a new line for the new version. Example: ```diff @@ -1017,7 +959,7 @@ It makes a warning show at the top of every page for that version. Expect the plain build to fail for the time being because of missing data files. -9. You can use CircleCI to initially generate the data files for the new version, +6. You can use CircleCI to initially generate the data files for the new version, like the startup option dumps. You can also populate the example cache at the same time. diff --git a/toolchain/arangoproxy/go.mod b/toolchain/arangoproxy/go.mod index 7299449b57..653608b9cf 100644 --- a/toolchain/arangoproxy/go.mod +++ b/toolchain/arangoproxy/go.mod @@ -5,5 +5,4 @@ go 1.18 require ( github.com/dlclark/regexp2 v1.7.0 gopkg.in/yaml.v3 v3.0.1 -) - +) \ No newline at end of file diff --git a/toolchain/docker/amd64/docker-compose.yml b/toolchain/docker/amd64/docker-compose.yml index 6990fc6d9e..f8b7a56955 100644 --- a/toolchain/docker/amd64/docker-compose.yml +++ b/toolchain/docker/amd64/docker-compose.yml @@ -5,20 +5,13 @@ services: image: arangodb/docs-hugo:toolchain-amd64 tty: true volumes: - - ${ARANGODB_SRC_3_10:-/dev/null}:/tmp/3.10 - - ${ARANGODB_SRC_3_11:-/tmp/1}:/tmp/3.11 - - ${ARANGODB_SRC_3_12:-/tmp/2}:/tmp/3.12 + - ${ARANGODB_SRC:-/dev/null}:/tmp/arangodb_src + - /tmp/arangodb:/tmp/arangodb - ../../../:/home/ - /var/run/docker.sock:/var/run/docker.sock environment: ENV: ${ENV:-local} HUGO_URL: ${HUGO_URL:-http://localhost} HUGO_ENV: ${HUGO_ENV:-development} - GENERATORS: ${GENERATORS} OVERRIDE: ${OVERRIDE} - ARANGODB_SRC_3_10: ${ARANGODB_SRC_3_10} - ARANGODB_SRC_3_11: ${ARANGODB_SRC_3_11} - ARANGODB_SRC_3_12: ${ARANGODB_SRC_3_12} - ARANGODB_BRANCH_3_10: ${ARANGODB_BRANCH_3_10} - ARANGODB_BRANCH_3_11: ${ARANGODB_BRANCH_3_11} - ARANGODB_BRANCH_3_12: ${ARANGODB_BRANCH_3_12} \ No newline at end of file + ARANGODB_SRC: ${ARANGODB_SRC} \ No newline at end of file diff --git a/toolchain/docker/arm64/docker-compose.yml b/toolchain/docker/arm64/docker-compose.yml index 3f19076ba1..8ed60d76df 100644 --- a/toolchain/docker/arm64/docker-compose.yml +++ b/toolchain/docker/arm64/docker-compose.yml @@ -5,20 +5,13 @@ services: image: arangodb/docs-hugo:toolchain-arm64 tty: true volumes: - - ${ARANGODB_SRC_3_10:-/dev/null}:/tmp/3.10 - - ${ARANGODB_SRC_3_11:-/tmp/1}:/tmp/3.11 - - ${ARANGODB_SRC_3_12:-/tmp/2}:/tmp/3.12 + - ${ARANGODB_SRC:-/dev/null}:/tmp/arangodb_src + - /tmp/arangodb:/tmp/arangodb - ../../../:/home/ - /var/run/docker.sock:/var/run/docker.sock environment: ENV: ${ENV:-local} HUGO_URL: ${HUGO_URL:-http://localhost} HUGO_ENV: ${HUGO_ENV:-development} - GENERATORS: ${GENERATORS} OVERRIDE: ${OVERRIDE} - ARANGODB_SRC_3_10: ${ARANGODB_SRC_3_10} - ARANGODB_SRC_3_11: ${ARANGODB_SRC_3_11} - ARANGODB_SRC_3_12: ${ARANGODB_SRC_3_12} - ARANGODB_BRANCH_3_10: ${ARANGODB_BRANCH_3_10} - ARANGODB_BRANCH_3_11: ${ARANGODB_BRANCH_3_11} - ARANGODB_BRANCH_3_12: ${ARANGODB_BRANCH_3_12} \ No newline at end of file + ARANGODB_SRC: ${ARANGODB_SRC} \ No newline at end of file diff --git a/toolchain/docker/config.yaml b/toolchain/docker/config.yaml index c2c278d00f..cbf7a8fa09 100644 --- a/toolchain/docker/config.yaml +++ b/toolchain/docker/config.yaml @@ -1,10 +1,2 @@ -generators: ${GENERATORS} -servers: - - image: ${ARANGODB_BRANCH_3_10_IMAGE} - version: ${ARANGODB_BRANCH_3_10_VERSION} - - - image: ${ARANGODB_BRANCH_3_11_IMAGE} - version: ${ARANGODB_BRANCH_3_11_VERSION} - - - image: ${ARANGODB_BRANCH_3_12_IMAGE} - version: ${ARANGODB_BRANCH_3_12_VERSION} +generators: "" +servers: "" \ No newline at end of file diff --git a/toolchain/docker/docker-compose.local.yml b/toolchain/docker/docker-compose.local.yml deleted file mode 100644 index 911a965b6a..0000000000 --- a/toolchain/docker/docker-compose.local.yml +++ /dev/null @@ -1,25 +0,0 @@ -version: "3.5" -services: - toolchain: - container_name: toolchain - image: toolchain - build: - context: . - target: toolchain - volumes: - - ${ARANGODB_SRC:-/dev/null}:${ARANGODB_SRC:-/dev/null} - - ${ARANGODB_SRC_2:-/tmp/1}:${ARANGODB_SRC_2:-/tmp/1} - - ${ARANGODB_SRC_3:-/tmp/2}:${ARANGODB_SRC_3:-/tmp/2} - - ../../:/home/ - - /var/run/docker.sock:/var/run/docker.sock - environment: - ENV: ${ENV:-local} - HUGO_URL: ${HUGO_URL:-http://localhost} - HUGO_ENV: ${HUGO_ENV:-development} - GENERATORS: ${GENERATORS} - ARANGODB_SRC_3_10: ${ARANGODB_SRC_3_10} - ARANGODB_SRC_3_11: ${ARANGODB_SRC_3_11} - ARANGODB_SRC_3_12: ${ARANGODB_SRC_3_12} - ARANGODB_BRANCH_3_10: ${ARANGODB_BRANCH_3_10} - ARANGODB_BRANCH_3_11: ${ARANGODB_BRANCH_3_11} - ARANGODB_BRANCH_3_12: ${ARANGODB_BRANCH_3_12} \ No newline at end of file diff --git a/toolchain/scripts/generators/generateApiDocs.py b/toolchain/scripts/generators/generateApiDocs.py deleted file mode 100644 index 49d3db3923..0000000000 --- a/toolchain/scripts/generators/generateApiDocs.py +++ /dev/null @@ -1,154 +0,0 @@ -import argparse -import yaml -import os -import json -import re -import traceback -from functools import reduce # forward compatibility for Python 3 -import operator - - - -##CMDLINE ARGS -parser = argparse.ArgumentParser(description='Optional app description') -parser.add_argument('--src', type=str, - help='docs/ folder') -parser.add_argument('--dst', type=str, - help='api-docs.json file destination') -parser.add_argument('--version', type=str, - help='documentation version folder') -args = parser.parse_args() - -if args.src is None or args.dst is None or args.version is None: - print("Args are required") - exit(1) - -# Handle Windows and trailing path separators -docs = args.src -dst = args.dst -version = args.version - -apiDocsRes = { - "openapi": "3.1.0", - "info": { - "description": "ArangoDB REST API Interface", - "version": "3.10.5", # TODO: Don't hardcode the ArangoDB version - "title": "ArangoDB", - "license": { - "name": "Apache License, Version 2.0" - } - }, - "tags": { - - }, - "paths" : {} -} - -def generateAPIDocs(): - print("PARSING DOCUMENTATION FILES") - for root, dirs, files in os.walk(f"{docs}/site/content/{version}", topdown=True): - if root.endswith("images"): - continue - - for file in files: - processFile(f"{root}/{file}".replace("\\", "/")) - - print("END") - -def loadTags(): - print("GENERATING TAGS") - try: - file = open(f"{docs}/site/data/openapi_tags.yaml", "r", encoding="utf-8") - data = file.read() - file.close() - except Exception as ex: - print(traceback.format_exc()) - raise ex - - tags = yaml.safe_load(data) - apiDocsRes["tags"] = tags - print(f"TAGS GENERATED") - -def processFile(filepath): - try: - file = open(filepath, "r", encoding="utf-8") - data = file.read() - file.close() - except Exception as ex: - print(f"Error reading file {filepath}") - print(traceback.format_exc()) - raise ex - - endpoints = re.findall(r"\`{3}openapi(.*?)\`{3}", data, re.MULTILINE | re.DOTALL) - for endpoint in endpoints: - endpointDict = yaml.safe_load(endpoint) - path = next(iter(endpointDict["paths"])) - method = next(iter(endpointDict["paths"][path])) - if not path in apiDocsRes["paths"]: - apiDocsRes["paths"][path] = {} - - summary = re.search(r"^#{1,6} (.+)", endpoint, re.MULTILINE) - if "summary" in endpointDict["paths"][path][method]: - print(f"WARNING: Summary field already in spec {method}-{path}") - - if summary: - endpointDict["paths"][path][method]["summary"] = summary.group(1) - - if not "summary" in endpointDict["paths"][path][method] and not summary: - print(f"WARNING: Missing both summary field and headline in spec {method}-{path}") - - - apiDocsRes["paths"][path][method] = endpointDict["paths"][path][method] - - processDescriptions(apiDocsRes, "") - - dstFile = open(dst, "w") - json.dump(apiDocsRes, dstFile, indent=2) - dstFile.close() - - - -def getFromDict(dataDict, mapList): - return reduce(operator.getitem, mapList, dataDict) - -def setInDict(dataDict, mapList, value): - mapList = mapList.split(",")[1:] - getFromDict(dataDict, mapList[:-1])[mapList[-1]] = value - -def delFromDict(dataDict, mapList): - mapList = mapList.split(",")[1:] - del getFromDict(dataDict, mapList[:-1])[mapList[-1]] - -def processDescriptions(data, k): - for key, value in data.items(): - if not "description" in value: - if isinstance(value, dict): - processDescriptions(value, k + "," + key) - else: - desc = value["description"] - if re.search(r"{{< (?:warning|info|danger|success|tip) >}}", desc, re.MULTILINE): - newDesc = generateNewDesc(desc) - setInDict(apiDocsRes, f"{k},{key},description", newDesc) - -def generateNewDesc(oldDesc): - newDesc = "" - insideHint = False - for line in oldDesc.split("\n"): - hint = re.search(r"{{< (warning|info|danger|success|tip) >}}", line) - if hint: - insideHint = True - newDesc += f"> **{hint[1].upper()}**:\n" - elif re.search(r"{{< /(?:warning|info|danger|success|tip) >}}", line): - insideHint = False - else: - if insideHint: - newDesc += f"> {line}\n" - else: - newDesc += f"{line}\n" - return newDesc - -if __name__ == "__main__": - print("--- GENERATE API DOCS") - loadTags() - generateAPIDocs() - print("--- END") diff --git a/toolchain/scripts/generators/generateMetrics.py b/toolchain/scripts/generators/generateMetrics.py index bb464ed1a9..3b42e8a65f 100644 --- a/toolchain/scripts/generators/generateMetrics.py +++ b/toolchain/scripts/generators/generateMetrics.py @@ -59,7 +59,7 @@ def print_usage(): # Check that we are in the right place: LS_HERE = os.listdir(ARANGODB_SOURCE) -if not("arangod" in LS_HERE and "client-tools" in LS_HERE and "CMakeLists.txt" in LS_HERE): +if not("arangod" in LS_HERE): print("Please execute me in the main source dir!") sys.exit(1) diff --git a/toolchain/scripts/hugo.deb b/toolchain/scripts/hugo.deb deleted file mode 100644 index c584f68991..0000000000 Binary files a/toolchain/scripts/hugo.deb and /dev/null differ diff --git a/toolchain/scripts/toolchain.sh b/toolchain/scripts/toolchain.sh index 07ef9f6e33..f7d7dbd38b 100755 --- a/toolchain/scripts/toolchain.sh +++ b/toolchain/scripts/toolchain.sh @@ -16,53 +16,23 @@ TRAP=0 cd /home/toolchain/scripts - PYTHON_EXECUTABLE="python" -DOCKER_COMPOSE_ARGS="" LOG_TARGET="" - ### Check whether python or python3 is installed if ! command -v "$PYTHON_EXECUTABLE" &> /dev/null then PYTHON_EXECUTABLE="python3" fi - - echo "[INIT] Toolchain setup" -echo "[INIT] Environment variables:" - -## if no generators set, defaults to all -if [[ -z "${GENERATORS}" ]] || [ "${GENERATORS}" == "" ]; then - GENERATORS="examples metrics error-codes options optimizer" -fi - -## Split the ARANGODB_BRANCH env var into name, image, version fields (for CI/CD) -if [ "$ARANGODB_BRANCH_3_10" != "" ] ; then - export ARANGODB_BRANCH_3_10_IMAGE="$ARANGODB_BRANCH_3_10" - export ARANGODB_BRANCH_3_10_VERSION="3.10" -fi - -if [ "$ARANGODB_BRANCH_3_11" != "" ] ; then - export ARANGODB_BRANCH_3_11_IMAGE="$ARANGODB_BRANCH_3_11" - export ARANGODB_BRANCH_3_11_VERSION="3.11" -fi - -if [ "$ARANGODB_BRANCH_3_12" != "" ] ; then - export ARANGODB_BRANCH_3_12_IMAGE="$ARANGODB_BRANCH_3_12" - export ARANGODB_BRANCH_3_12_VERSION="3.12" -fi - -start_servers=false ## Expand environment variables in config.yaml, if present yq '(.. | select(tag == "!!str")) |= envsubst' -i ../docker/config.yaml GENERATORS=$(yq -r '.generators' ../docker/config.yaml) - if [ "$GENERATORS" == "" ]; then - GENERATORS="examples metrics error-codes options optimizer oasisctl" + GENERATORS="examples metrics error-codes options optimizer" fi @@ -74,10 +44,9 @@ echo "" echo "[TOOLCHAIN] Clean arangoproxy config file" yq '.repositories = []' -i ../arangoproxy/cmd/configs/local.yaml - - echo "[INIT] Setup Finished" +trap 'terminate_toolchain' SIGINT SIGTERM SIGQUIT SIGKILL @@ -90,23 +59,24 @@ function main() { clean_docker_environment - mapfile servers < <(yq e -o=j -I=0 '.servers[]' ../docker/config.yaml ) - + mapfile configServers < <(yq e -o=j -I=0 '.servers' ../docker/config.yaml | tr -d { | tr -d } | tr -d ' ' | tr -d '"') + IFS=',' read -ra servers <<< "$configServers" + ## Generate content and start server for server in "${servers[@]}"; do - image=$(echo "$server" | yq e '.image' -) - version=$(echo "$server" | yq e '.version' -) - - if [ "$image" == "" ]; then - continue - fi - + IFS=':' read -r version image <<< "$server" + echo $image $version if [ $HUGO_ENV == "release" ]; then rm -r ../../site/data/$version/* echo "{}" > ../../site/data/$version/cache.json fi - process_server "$server" + + if [ "$ARANGODB_SRC" != "" ]; then + mkdir -p /tmp/arangodb/$version + fi + + process_server "$version" "$image" done run_arangoproxy_and_site @@ -116,16 +86,17 @@ function main() { echo "