mirror of
https://gitee.com/ant-design-vue/ant-design-vue.git
synced 2024-12-15 17:31:43 +08:00
19 lines
413 B
JavaScript
19 lines
413 B
JavaScript
'use strict';
|
|
|
|
// NOTE: the following code was partially adopted from https://github.com/iarna/in-publish
|
|
module.exports = function getNpmArgs() {
|
|
let npmArgv = null;
|
|
|
|
try {
|
|
npmArgv = JSON.parse(process.env.npm_config_argv);
|
|
} catch (err) {
|
|
return null;
|
|
}
|
|
|
|
if (typeof npmArgv !== 'object' || !npmArgv.cooked || !Array.isArray(npmArgv.cooked)) {
|
|
return null;
|
|
}
|
|
|
|
return npmArgv.cooked;
|
|
};
|