1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-19 23:22:16 +03:00
esp8266/tools/mkdir.py
Takayuki 'January June' Suwa fd69945abc
Fix: cannot build after #7060 on Win64 (#7754)
* Fix: cannot build after #7060 on Win64

* add double-quotes to `compiler.S.flags`

* fix windows-specific processes (`recipe.hooks.linking.prelink.[12].pattern.windows`)

* rewrite processing of "mkdir" and "cp" in python because of platform-independence

* make consistent with the use of quotation marks in other *.py files
2020-12-14 11:09:24 -08:00

20 lines
571 B
Python
Executable File

#!/usr/bin/env python3
# Platform-independent `mkdir`
import argparse
import pathlib
import sys
def main():
parser = argparse.ArgumentParser(description='Platform-independent `mkdir`')
parser.add_argument('-p', '--parents', action='store_true', required=False, help='no error if existing, make parent directories as needed')
parser.add_argument('dir', action='store', nargs='+')
ns = parser.parse_args()
for p in ns.dir:
pathlib.Path(p).mkdir(parents=ns.parents, exist_ok=True)
return 0
if __name__ == '__main__':
sys.exit(main())