Skip to content

Commit 173fbda

Browse files
committed
fix: expose with script as script.meta.suffix for abigail-plugin-log
1 parent ee7fbe1 commit 173fbda

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

src/Script.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import { parse } from 'shell-quote';
22

33
export default class Script {
4-
constructor(name, raw) {
4+
constructor(name, raw, meta = {}) {
55
this.name = name;
66
this.raw = raw;
7+
this.meta = meta;
78
this.parsed = parse(raw);
89
this.canSpawn = this.parsed.reduce((can, op) => can && typeof op === 'string', true);
910
}

src/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,18 @@ export default class Parse extends Plugin {
2828
if (options.suffixes && options.suffixes.length) {
2929
suffix = ` ${options.suffixes.join(' ')}`;
3030
}
31-
const main = new Script(key, scripts[key] + suffix);
31+
const main = new Script(key, scripts[key] + suffix, { suffix });
3232

3333
const preKey = `pre${key}`;
3434
let pre;
3535
if (scripts[preKey]) {
36-
pre = new Script(preKey, scripts[preKey] + suffix);
36+
pre = new Script(preKey, scripts[preKey] + suffix, { suffix });
3737
}
3838

3939
const postKey = `post${key}`;
4040
let post;
4141
if (scripts[postKey]) {
42-
post = new Script(postKey, scripts[postKey] + suffix);
42+
post = new Script(postKey, scripts[postKey] + suffix, { suffix });
4343
}
4444

4545
return { pre, main, post };

0 commit comments

Comments
 (0)