mirror of
https://github.com/dolthub/dolt.git
synced 2026-05-23 02:40:49 -05:00
25 lines
783 B
Python
Executable File
25 lines
783 B
Python
Executable File
#!/usr/bin/python
|
|
|
|
# Copyright 2016 The Noms Authors. All rights reserved.
|
|
# Licensed under the Apache License, version 2.0:
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
import os, subprocess, json
|
|
from distutils.version import LooseVersion
|
|
|
|
def main():
|
|
os.chdir('js')
|
|
deployed_version = LooseVersion(
|
|
subprocess.check_output(['npm', 'info', '@attic/noms', 'version']).strip())
|
|
with open('package.json') as pkg:
|
|
data = json.load(pkg)
|
|
new_version = LooseVersion(data['version'])
|
|
print 'Old version: %s, New version: %s' % (deployed_version, new_version)
|
|
if new_version > deployed_version:
|
|
subprocess.check_call(['npm', 'whoami'])
|
|
subprocess.check_call(['npm', 'install'])
|
|
subprocess.check_call(['npm', 'publish'])
|
|
|
|
if __name__ == '__main__':
|
|
main()
|