fix(core.gbapp): #341 fix regarding COPY files.
This commit is contained in:
parent
f2889879a6
commit
a292b77116
4 changed files with 18 additions and 10 deletions
|
@ -426,9 +426,9 @@ export class DialogKeywords {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns current time in format hh:dd.
|
* Returns current time in format hh:mm.
|
||||||
*
|
*
|
||||||
* @example SAVE "contacts.xlsx", name, email, NOW
|
* @example NOW
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public async getNow({ pid }) {
|
public async getNow({ pid }) {
|
||||||
|
@ -1133,6 +1133,11 @@ export class DialogKeywords {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
else if (filename.url)
|
||||||
|
{
|
||||||
|
url = filename.url;
|
||||||
|
}
|
||||||
|
|
||||||
// Handles Markdown.
|
// Handles Markdown.
|
||||||
else if (filename.indexOf('.md') > -1) {
|
else if (filename.indexOf('.md') > -1) {
|
||||||
GBLog.info(`BASIC: Sending the contents of ${filename} markdown to mobile ${mobile}.`);
|
GBLog.info(`BASIC: Sending the contents of ${filename} markdown to mobile ${mobile}.`);
|
||||||
|
|
|
@ -684,7 +684,7 @@ export class KeywordsExpressions {
|
||||||
keywords[i++] = [
|
keywords[i++] = [
|
||||||
/^\s*(copy)(\s*)(.*)/gim,
|
/^\s*(copy)(\s*)(.*)/gim,
|
||||||
($0, $1, $2, $3) => {
|
($0, $1, $2, $3) => {
|
||||||
const params = this.getParams($3, ['src', 'dst']);
|
const params = this.getParams($3, ['src', 'dest']);
|
||||||
return `await sys.copyFile ({pid: pid, ${params}})`;
|
return `await sys.copyFile ({pid: pid, ${params}})`;
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
@ -692,7 +692,7 @@ export class KeywordsExpressions {
|
||||||
keywords[i++] = [
|
keywords[i++] = [
|
||||||
/^\s*(convert)(\s*)(.*)/gim,
|
/^\s*(convert)(\s*)(.*)/gim,
|
||||||
($0, $1, $2, $3) => {
|
($0, $1, $2, $3) => {
|
||||||
const params = this.getParams($3, ['src', 'dst']);
|
const params = this.getParams($3, ['src', 'dest']);
|
||||||
return `await sys.convert ({pid: pid, ${params}})`;
|
return `await sys.convert ({pid: pid, ${params}})`;
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
@ -727,9 +727,9 @@ export class KeywordsExpressions {
|
||||||
];
|
];
|
||||||
|
|
||||||
keywords[i++] = [
|
keywords[i++] = [
|
||||||
/^\s*SCREENSHOT\s*(.*)/gim,
|
/^\s*((?:[a-z]+.?)(?:(?:\w+).)(?:\w+)*)\s*=\s*SCREENSHOT\s*(.*)/gim,
|
||||||
($0, $1, $2) => {
|
($0, $1, $2) => {
|
||||||
return `await wa.screenshot({pid: pid, handle: page, selector: ${$1}})`;
|
return `${$1} = await wa.screenshot({pid: pid, handle: page, selector: ${$1}})`;
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -788,8 +788,7 @@ export class KeywordsExpressions {
|
||||||
keywords[i++] = [
|
keywords[i++] = [
|
||||||
/^\s*((?:[a-z]+.?)(?:(?:\w+).)(?:\w+)*)\s*=\s*BLUR\s*(.*)/gim,
|
/^\s*((?:[a-z]+.?)(?:(?:\w+).)(?:\w+)*)\s*=\s*BLUR\s*(.*)/gim,
|
||||||
($0, $1, $2, $3) => {
|
($0, $1, $2, $3) => {
|
||||||
return `
|
return `${$1} = await img.blur({pid: pid, args: [${$2}]})`;
|
||||||
${$1} = await img.blur({pid: pid, args: [${$2}]})`;
|
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
@ -316,7 +316,7 @@ export class WebAutomationServices {
|
||||||
/**
|
/**
|
||||||
* Returns the screenshot of page or element
|
* Returns the screenshot of page or element
|
||||||
*
|
*
|
||||||
* @example file = SCREENSHOT page
|
* @example file = SCREENSHOT "#selector"
|
||||||
*/
|
*/
|
||||||
public async screenshot({ pid, handle, selector }) {
|
public async screenshot({ pid, handle, selector }) {
|
||||||
const { min, user } = await DialogKeywords.getProcessInfo(pid);
|
const { min, user } = await DialogKeywords.getProcessInfo(pid);
|
||||||
|
@ -331,7 +331,7 @@ export class WebAutomationServices {
|
||||||
const url = urlJoin(GBServer.globals.publicAddress, min.botId, 'cache', Path.basename(localName));
|
const url = urlJoin(GBServer.globals.publicAddress, min.botId, 'cache', Path.basename(localName));
|
||||||
GBLog.info(`BASIC: WebAutomation: Screenshot captured at ${url}.`);
|
GBLog.info(`BASIC: WebAutomation: Screenshot captured at ${url}.`);
|
||||||
|
|
||||||
return url;
|
return { data: null, localName: localName, url: url };
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -112,6 +112,10 @@ export class GBServer {
|
||||||
GBLog.error(`UNCAUGHT_EXCEPTION: ${err.toString()} ${err['stack'] ? '\n' + err['stack'] : ''}`);
|
GBLog.error(`UNCAUGHT_EXCEPTION: ${err.toString()} ${err['stack'] ? '\n' + err['stack'] : ''}`);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
process.on('SIGTERM', () => {
|
||||||
|
GBLog.info('SIGTERM signal received.');
|
||||||
|
});
|
||||||
|
|
||||||
// Creates working directory.
|
// Creates working directory.
|
||||||
|
|
||||||
process.env.PWD = process.cwd();
|
process.env.PWD = process.cwd();
|
||||||
|
|
Loading…
Add table
Reference in a new issue