Skip to content

Commit

Permalink
Remove workaround from make test now that links are idempotent
Browse files Browse the repository at this point in the history
  • Loading branch information
kaushalmodi committed Jan 5, 2022
1 parent 94bd2f8 commit 8965bab
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions Makefile
Expand Up @@ -237,18 +237,13 @@ ctemp:
@find $(OX_HUGO_TEST_SITE_DIR)/content -name "*.*~" -delete
@find ./doc/content -name "*.*~" -delete

# Before doing the diff, replace the randomly generated org reference
# id's like "org123abcd" with "orgxxxxxxx" so that the diff doesn't
# fail on those id mismatches.
# Also get rid of all changes in $(OX_HUGO_TEST_SITE_DIR)/content
# after making a copy to $(OX_HUGO_TEST_SITE_DIR)/content-modified.
# Get rid of all changes in $(OX_HUGO_TEST_SITE_DIR)/content after
# making a copy to $(OX_HUGO_TEST_SITE_DIR)/content-modified.
# https://stackoverflow.com/a/16589534/1219634
diffgolden:
@rm -rf $(OX_HUGO_TEST_SITE_DIR)/content-modified
@cp -rf $(OX_HUGO_TEST_SITE_DIR)/content $(OX_HUGO_TEST_SITE_DIR)/content-modified
@git checkout --ignore-skip-worktree-bits -- $(OX_HUGO_TEST_SITE_DIR)/content
@find $(OX_HUGO_TEST_SITE_DIR)/content-modified -name "*.md" -exec perl -pi -e 's/(["#]org)([a-f0-9]{7})/\1xxxxxxx/' -- '{}' +
@find $(OX_HUGO_TEST_SITE_DIR)/content-golden -name "*.md" -exec perl -pi -e 's/(["#]org)([a-f0-9]{7})/\1xxxxxxx/' -- '{}' +
@diff -r $(OX_HUGO_TEST_SITE_DIR)/content-modified $(OX_HUGO_TEST_SITE_DIR)/content-golden

clean: ctemp
Expand Down

0 comments on commit 8965bab

Please sign in to comment.