|
| 1 | +#! /usr/bin/env node |
| 2 | + |
| 3 | +/************************************************************* |
| 4 | + * |
| 5 | + * Copyright (c) 2022 The MathJax Consortium |
| 6 | + * |
| 7 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 8 | + * you may not use this file except in compliance with the License. |
| 9 | + * You may obtain a copy of the License at |
| 10 | + * |
| 11 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 12 | + * |
| 13 | + * Unless required by applicable law or agreed to in writing, software |
| 14 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 15 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 16 | + * See the License for the specific language governing permissions and |
| 17 | + * limitations under the License. |
| 18 | + */ |
| 19 | + |
| 20 | +/** |
| 21 | + * @fileoverview Creates the version.ts file from the package version number |
| 22 | + * |
| 23 | + * @author dpvc@mathjax.org (Davide Cervone) |
| 24 | + */ |
| 25 | + |
| 26 | + |
| 27 | +const fs = require('fs'); |
| 28 | +const path = require('path'); |
| 29 | + |
| 30 | +const package = path.resolve(__dirname, '..', '..', 'package.json'); |
| 31 | +const version = require(package).version; |
| 32 | + |
| 33 | +const lines = `/************************************************************* |
| 34 | + * |
| 35 | + * Copyright (c) 2022 The MathJax Consortium |
| 36 | + * |
| 37 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 38 | + * you may not use this file except in compliance with the License. |
| 39 | + * You may obtain a copy of the License at |
| 40 | + * |
| 41 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 42 | + * |
| 43 | + * Unless required by applicable law or agreed to in writing, software |
| 44 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 45 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 46 | + * See the License for the specific language governing permissions and |
| 47 | + * limitations under the License. |
| 48 | + */ |
| 49 | +
|
| 50 | +/** |
| 51 | + * @fileoverview The version of MathJax (used to tell what version a component |
| 52 | + * was compiled against). |
| 53 | + * |
| 54 | + * @author dpvc@mathjax.org (Davide Cervone) |
| 55 | + */ |
| 56 | +
|
| 57 | +export const VERSION = '${version}'; |
| 58 | +`; |
| 59 | + |
| 60 | +fs.writeFileSync(path.resolve(__dirname, '..', '..', 'ts', 'components', 'version.ts'), lines); |
0 commit comments