-
-
Notifications
You must be signed in to change notification settings - Fork 74
Expand file tree
/
Copy pathrender-version.js
More file actions
26 lines (21 loc) · 879 Bytes
/
render-version.js
File metadata and controls
26 lines (21 loc) · 879 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
'use strict';
const path = require('path');
const { version } = require('../../package');
const isStandaloneExecutable = require('../utils/is-standalone-executable');
const localServerlessPath = require('./local-serverless-path');
const { writeText } = require('../utils/serverless-utils/log');
const serverlessPath = path.resolve(__dirname, '../..');
module.exports = async () => {
const installationModePostfix = (() => {
if (isStandaloneExecutable) return ' (standalone)';
if (serverlessPath === localServerlessPath) return ' (local)';
return '';
})();
const globalInstallationPostfix = (() => {
if (EvalError.$serverlessInitInstallationVersion) {
return ` ${EvalError.$serverlessInitInstallationVersion} (global)`;
}
return '';
})();
writeText(`osls version: ${version}${installationModePostfix}${globalInstallationPostfix}`);
};