File: obsolete-files.py

package info (click to toggle)
ansible-core 2.19.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 32,840 kB
  • sloc: python: 181,406; cs: 4,929; sh: 4,630; xml: 34; makefile: 21
file content (18 lines) | stat: -rw-r--r-- 411 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
"""Prevent files from being added to directories that are now obsolete."""

from __future__ import annotations

import os
import sys


def main():
    """Main entry point."""
    paths = sys.argv[1:] or sys.stdin.read().splitlines()

    for path in paths:
        print('%s: directory "%s/" is obsolete and should not contain any files' % (path, os.path.dirname(path)))


if __name__ == '__main__':
    main()