https://github.com/sagemathinc/cocalc
Raw File
Tip revision: 11bffe1ce0028ea5661683983f33e047447348d4 authored by Harald Schilly on 14 December 2022, 09:50:16 UTC
next/store: move isAcademic to misc, expand its scope, and add tests -- fixes #6242
Tip revision: 11bffe1
update_version
#!/usr/bin/env python

'''
This updates the version file, which bakes this data into the webapp.

To force an update for users (showing them an information box that they have to update)
wait until deployed and set the "version" in the database.

Goto account -> admin site settings -> required browser version
'''

import argparse, os, time

ROOT = os.path.dirname(os.path.realpath(__file__))
TARGET = os.path.join(ROOT, "packages/util/smc-version.js")

def write_version_file():
    # Create version file, based on the current time
    now = int(time.time())
    v = []
    v.append("/* autogenerated by the update_version script */")
    v.append("exports.version=%s;"%now)
    open(TARGET,'w').write('\n'.join(v) + '\n')
    os.chdir(os.path.join(ROOT, "packages/util"))
    os.system("npm run build")

if __name__ == "__main__":
    parser = argparse.ArgumentParser(description='Update CoCalc frontend version number')
    args = parser.parse_args()
    write_version_file()


back to top