Skip to content

Instantly share code, notes, and snippets.

@yuarasino
Last active January 11, 2020 10:38
Show Gist options
  • Save yuarasino/b067dc06ef79eda85f2194ae2c2f5b83 to your computer and use it in GitHub Desktop.
Save yuarasino/b067dc06ef79eda85f2194ae2c2f5b83 to your computer and use it in GitHub Desktop.
Live2D Cubism SDK for Web のtsコードの先頭に、@ts-nockeckを付与するpythonスクリプト
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