Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Commit

Permalink
save changes
Browse files Browse the repository at this point in the history
changing to other branch, delete later
  • Loading branch information
alanssitis committed Mar 29, 2023
1 parent 040855e commit ef846ef
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions scripts/directory-tree-check.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,28 @@
#! /bin/python3

from functools import reduce
import re
import sys
import os
import pprint

ignore_set = ('CMakeLists.txt', 'README.md', 'package.xml')

start_marker = '<!-- directory-tree-check-start -->\n'
end_marker = '<!-- directory-tree-check-end -->\n'


def check_pkg_readme(pkg_dir, dir_tree):
pp = pprint.PrettyPrinter(indent=2)
print(pkg_dir)
pp.pprint(dir_tree)
with open(os.path.join(pkg_dir, 'README.md'), 'r') as f:
lines = f.readlines()
md_tree = ''.join(lines[lines.index(start_marker) +
2:lines.index(end_marker) - 1])

if dir_tree != get_dir_tree_from_md(md_tree):
sys.exit(f'Package directory "{pkg_dir}" README is not updated.')


def get_dir_tree_from_md(md_tree):
print(md_tree)
pass


Expand Down

0 comments on commit ef846ef

Please sign in to comment.