Last active
January 11, 2020 10:38
-
-
Save yuarasino/b067dc06ef79eda85f2194ae2c2f5b83 to your computer and use it in GitHub Desktop.
Live2D Cubism SDK for Web のtsコードの先頭に、@ts-nockeckを付与するpythonスクリプト
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import glob | |
def main(): | |
src_dir = "./Framework" | |
dst_dir = "./_Framework" | |
for src_ts in glob.glob(os.path.join(src_dir, "**/*.ts"), recursive=True): | |
dst_ts = src_ts.replace(src_dir, dst_dir) | |
os.makedirs(os.path.dirname(dst_ts), exist_ok=True) | |
with open(src_ts) as f, open(dst_ts, "w") as g: | |
content = f.read() | |
ts_nockeck = "// @ts-nocheck This file is not under project manegement.\n" | |
content = ts_nockeck + content | |
g.write(content) | |
if __name__ == "__main__": | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment