From 300bbd4f69d3b70e538a82a5eee0dd90f41d8334 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Fri, 11 Dec 2015 20:03:46 -0800 Subject: [PATCH] Support latest node using additional_dependencies --- pre_commit_mirror_maker/make_repo.py | 8 ++++---- pre_commit_mirror_maker/node/hooks.yaml | 9 +++++++++ pre_commit_mirror_maker/node/package.json | 7 ++----- 3 files changed, 15 insertions(+), 9 deletions(-) create mode 100644 pre_commit_mirror_maker/node/hooks.yaml diff --git a/pre_commit_mirror_maker/make_repo.py b/pre_commit_mirror_maker/make_repo.py index 288ec8a..ccb4e6d 100644 --- a/pre_commit_mirror_maker/make_repo.py +++ b/pre_commit_mirror_maker/make_repo.py @@ -99,11 +99,11 @@ def _apply_version_and_commit( format_files_to_directory(src_dir, '.', format_vars) # Commit and tag - subprocess.check_call(['git', 'add', '.']) - subprocess.check_call([ + subprocess.check_call(('git', 'add', '.')) + subprocess.check_call(( 'git', 'commit', '-m', 'Mirror: {0}'.format(version) - ]) - subprocess.check_call(['git', 'tag', 'v{0}'.format(version)]) + )) + subprocess.check_call(('git', 'tag', 'v{0}'.format(version))) def make_repo( diff --git a/pre_commit_mirror_maker/node/hooks.yaml b/pre_commit_mirror_maker/node/hooks.yaml new file mode 100644 index 0000000..0ac2176 --- /dev/null +++ b/pre_commit_mirror_maker/node/hooks.yaml @@ -0,0 +1,9 @@ +- id: {entry} + name: {name} + entry: {entry} + language: {language} + files: {files} + args: {args} + # Use additional_dependencies to install the actual node package + additional_dependencies: ['{name}@{version}'] + minimum_pre_commit_version: 0.7.0 diff --git a/pre_commit_mirror_maker/node/package.json b/pre_commit_mirror_maker/node/package.json index e2d4ddb..60aa5b6 100644 --- a/pre_commit_mirror_maker/node/package.json +++ b/pre_commit_mirror_maker/node/package.json @@ -1,8 +1,5 @@ {{ - "name": "__dummy_package", + "name": "dummy_package", "description": "Note: double curly-braces because python .format", - "version": "0.0.0", - "scripts": {{ - "preinstall": "npm install {name}@{version} -g" - }} + "version": "0.0.0" }}