fix config.js

This commit is contained in:
xmz 2024-04-19 15:14:28 +08:00
parent e68b1b4f82
commit f02ea6dcb9

View File

@ -5,7 +5,7 @@ const inputConfigKey = 'CONFIG_PATH';
const inputSshKeyPath = 'SSH_PRIVATE_KEY_PATH'; const inputSshKeyPath = 'SSH_PRIVATE_KEY_PATH';
const readConfig = (configPath) => { const readConfig = (configPath) => {
if (existsSync(configPath)) { if (!existsSync(configPath)) {
const message = `⚠️ [FILE] ${configPath} Required file exist.`; const message = `⚠️ [FILE] ${configPath} Required file exist.`;
throw new Error(message); throw new Error(message);
} }
@ -20,7 +20,7 @@ const readConfig = (configPath) => {
}; };
const readSshKey = (SshKeyPath) => { const readSshKey = (SshKeyPath) => {
if (existsSync(SshKeyPath)) { if (!existsSync(SshKeyPath)) {
const message = `⚠️ [FILE] ${SshKeyPath} Required file exist.`; const message = `⚠️ [FILE] ${SshKeyPath} Required file exist.`;
throw new Error(message); throw new Error(message);
} }