Add deprecation warning for "executeSingle"

This commit is contained in:
Jan Oberhauser 2021-05-21 22:51:38 -05:00
parent c67a120fed
commit 40614672e6

View file

@ -6,9 +6,16 @@ import {
ICredentialType, ICredentialType,
INodeType, INodeType,
INodeTypeData, INodeTypeData,
Logger,
LoggerProxy,
} from 'n8n-workflow'; } from 'n8n-workflow';
import * as config from '../config'; import * as config from '../config';
import {
getLogger,
} from '../src/Logger';
import { import {
access as fsAccess, access as fsAccess,
readdir as fsReaddir, readdir as fsReaddir,
@ -31,7 +38,12 @@ class LoadNodesAndCredentialsClass {
nodeModulesPath = ''; nodeModulesPath = '';
logger: Logger;
async init() { async init() {
this.logger = getLogger();
LoggerProxy.init(this.logger);
// Get the path to the node-modules folder to be later able // Get the path to the node-modules folder to be later able
// to load the credentials and nodes // to load the credentials and nodes
const checkPaths = [ const checkPaths = [
@ -171,6 +183,10 @@ class LoadNodesAndCredentialsClass {
tempNode.description.icon = 'file:' + path.join(path.dirname(filePath), tempNode.description.icon.substr(5)); tempNode.description.icon = 'file:' + path.join(path.dirname(filePath), tempNode.description.icon.substr(5));
} }
if (tempNode.executeSingle) {
this.logger.warn(`"executeSingle" will get deprecated soon. Please update the code of node "${packageName}.${nodeName}" to use "execute" instead!`, { filePath });
}
if (this.includeNodes !== undefined && !this.includeNodes.includes(fullNodeName)) { if (this.includeNodes !== undefined && !this.includeNodes.includes(fullNodeName)) {
return; return;
} }