intuit / intuit/auto

Cannot get local plugin to load

Open
#2,019 3 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
TypeScript
Stars
2.5k
Forks
221
PR merge metrics
No merged PRs in 30d

Description

I am attempting to get [this workaround](https://github.com/intuit/auto/issues/1294#issuecomment-643403558) for the E2BIG error to work, but I am unable to get auto (v10.29.3) to load my local plugin. I've tried setting the path to both `tools/exec-hooks.js` and `./tools/exec-hooks.js`, but both times auto just reports "`warning Could not find plugin: ./tools/exec-hooks.js`".

My `.autorc`:

```yaml
{
"onlyPublishWithReleaseLabel": true,
"baseBranch": "master",
"author": "auto ",
"noVersionPrefix": true,
"plugins": [
"git-tag",
#[
# "exec",
# {
# "beforeCommitChangelog": "mkdir -p env && env | grep -vP '^(GH_TOKEN|TWINE_PASSWORD)' > env/beforeCommitChangelog.env && git add env",
# "afterChangelog": "env | grep -vP '^(GH_TOKEN|TWINE_PASSWORD)' > env/afterChangelog.env && git add env && git commit -m afterChangelog && bump2version \"$(printf '%s\n' \"$ARG_0\" | jq -r .bump)\"",
# "afterRelease": "python -m build && twine upload dist/*"
# }
#]
"./tools/exec-hooks.js"
]
}
```

My `tools/exec-hooks.js`:
```js
const { SEMVER, execPromise, getCurrentBranch } = require("@auto-it/core");

module.exports = class ExecE2BIGWorkaround {
constructor() {
this.name = "Custom exec commands";
}

/**
* Setup the plugin
*
* @param {import('@auto-canary/core').default} auto
*/
apply(auto) {
auto.hooks.beforeCommitChangelog.tapPromise(this.name, async (config) => {
await execPromise("mkdir", ["-p", "env"]);
await execPromise("sh", ["env | grep -vP '^(GH_TOKEN|TWINE_PASSWORD)' > env/beforeCommitChangelog.env"]);
await execPromise("git", ["add", "env"]);
});

auto.hooks.afterChangelog.tapPromise(this.name, async ({bump}) => {
await execPromise("sh", ["env | grep -vP '^(GH_TOKEN|TWINE_PASSWORD)' > env/afterChangelog.env"]);
await execPromise("git", ["add", "env"]);
await execPromise("git", ["commit", "-m", "afterChangelog"]);
await execPromise("bump2version", [bump]);
});

auto.hooks.afterRelease.tapPromise(this.name, async (config) => {
await execPromise("python", ["-m", "build"]);
// Thankfully, twine expands globs!
await execPromise("twine", ["upload", "dist/*"]);
});
}
};
```

(If I've made any mistakes in writing the plugin, I'd appreciate them being pointed out; I am not a JavaScript person.)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.