Skip to content

A toolbox of film styles made in code for Claude Code: 66 ready to use, and your own. Each style is a style prompt plus a demo film made entirely in code by Claude Opus 5.5, with no video model. By Lemomo. · 一套用代码做片的风格工具箱:66 种现成风格,也能做出你自己的

tools/directory.py: refuse to sync without a higher version

lemomo-ai411f74d23ece
diff --git a/tools/directory.py b/tools/directory.py
index 83d9fa8..103c0e9 100644
--- a/tools/directory.py
+++ b/tools/directory.py
@@ -2,7 +2,8 @@
"""Build the Claude plugin directory edition of Lemo-Opuscar from main.
python3 tools/directory.py <version> build into .release/directory/
- python3 tools/directory.py <version> --into <dir> then sync it into <dir> (a worktree of the `directory` branch)
+ python3 tools/directory.py <version> --into <dir> then sync it into <dir> (a worktree of the `directory` branch);
+ <version> must be above the branch's, see MAINTAINING.md
The directory edition is a self-contained plugin: the guides, every STYLE.md / style.json / DEMO.md and the core/
tools travel inside the plugin, so nothing is cloned or fetched to tell the agent what to do. It leaves out the films,
@@ -225,8 +226,15 @@ def sync(into):
if __name__ == '__main__':
args = sys.argv[1:]
if not args or args[0].startswith('-'): die('usage: python3 tools/directory.py <version> [--into <worktree of the directory branch>]')
- build(args[0])
if '--into' in args:
i = args.index('--into')
if i + 1 >= len(args): die('--into needs a folder')
- sync(os.path.abspath(args[i + 1]))
+ into = os.path.abspath(args[i + 1])
+ # every release the directory publishes needs a higher version; --same-version only for fixes before the first publish
+ old = os.path.join(into, '.claude-plugin', 'plugin.json')
+ if os.path.exists(old) and '--same-version' not in args:
+ have = json.load(open(old, encoding='utf-8'))['version']
+ if tuple(map(int, args[0].split('.'))) <= tuple(map(int, have.split('.'))):
+ die(f'the directory branch is at {have}: give a higher version (or --same-version for a fix that was never published)')
+ build(args[0])
+ if '--into' in args: sync(into)