Skip to content

Commit

Permalink
Use prepare script to setup public link-to-repo when available (open-…
Browse files Browse the repository at this point in the history
  • Loading branch information
chalin authored Feb 22, 2022
1 parent 4407bbc commit 588574f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
13 changes: 13 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
HTMLTEST_DIR=tmp
HTMLTEST?=htmltest # Specify as make arg if different
HTMLTEST_ARGS?=--skip-external
OTEL_GEN_REPO?=../$(shell basename $(shell pwd)).g

# Use $(HTMLTEST) in PATH, if available; otherwise, we'll get a copy
ifeq (, $(shell which $(HTMLTEST)))
Expand All @@ -19,3 +20,15 @@ clean:
get-link-checker:
rm -Rf $(HTMLTEST_DIR)/bin
curl https://htmltest.wjdp.uk | bash -s -- -b $(HTMLTEST_DIR)/bin

# For local development, create `public` as a symlink to a given git repo (if it
# exists), for the purpose of tracking build changes:
public:
@if [[ -e "$(OTEL_GEN_REPO)" ]]; then \
set -x && ln -s $(OTEL_GEN_REPO) public; \
elif [[ -z "$(CI)" ]]; then \
echo "WARNING: cannot link public to '$(OTEL_GEN_REPO)' since the directory doesn't exist"; \
fi

ls-public:
if [[ -e public ]]; then ls -ld public; fi
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"_get:no": "echo SKIPPING get operation",
"_get:submodule": "set -x && git submodule update --init ${DEPTH:- --depth 1}",
"_get:submodule:non-lang": "npm run _get:submodule -- content-modules/opentelemetry-specification themes/docsy",
"_mkdir:public": "make public ls-public",
"_prebuild": "run-s get:submodule cp:spec",
"_prepare:docsy": "cd themes/docsy && npm install",
"_serve:hugo": "hugo serve -DFE --minify",
Expand All @@ -31,7 +32,7 @@
"prebuild": "npm run _prebuild",
"precheck-links:all": "npm run build",
"precheck-links": "npm run build",
"prepare": "run-s get:submodule _prepare:docsy",
"prepare": "run-s get:submodule _prepare:docsy _mkdir:public",
"preserve:hugo": "npm run _prebuild",
"preserve": "npm run _prebuild",
"s": "run-s",
Expand Down

0 comments on commit 588574f

Please sign in to comment.