From 3ff830f0d66c65ae2c05d31d83d5bbc6f1c4252e Mon Sep 17 00:00:00 2001 From: "Ryoga.exe" Date: Sun, 23 Oct 2022 23:07:43 +0900 Subject: [PATCH] update: generate-snippet.py --- generate-snippet.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/generate-snippet.py b/generate-snippet.py index b289e6a..f022c50 100644 --- a/generate-snippet.py +++ b/generate-snippet.py @@ -23,11 +23,11 @@ def create_snippet(file_path): options = {} for index, line in enumerate(lines): - if line == '/// start': + if line.strip() == '/// start': startline = index + 1 - if line.startswith('/// @'): - key = line[5:].split(' ')[0] - value = line[5 + len(key) + 1:] + if line.strip().startswith('/// @'): + key = line.strip()[5:].split(' ')[0] + value = line.strip()[5 + len(key) + 1:] if key == 'isFileTemplate': if value == 'true': options[key] = True @@ -101,4 +101,4 @@ def write_file(snippets, directory, filename): write_file(snippets, directory, filename) print("Created", filename, "from", dir_name) - + \ No newline at end of file