Skip to content

Commit

Permalink
fix: clis don't delete themselves (#621)
Browse files Browse the repository at this point in the history
* fix: clis don't delete themselves

* ci: use squash merges
  • Loading branch information
mshanemc authored Sep 5, 2023
1 parent 8d3cefe commit ca57247
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/workflows/automerge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ jobs:
uses: salesforcecli/github-workflows/.github/workflows/automerge.yml@main
secrets:
SVC_CLI_BOT_GITHUB_TOKEN: ${{ secrets.SVC_CLI_BOT_GITHUB_TOKEN }}
with:
mergeMethod: squash
4 changes: 3 additions & 1 deletion src/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,9 @@ export class Updater {
if (!await fs.pathExists(root)) return
const files = await ls(root)
const promises = files.map(async (f: any) => {
if (['bin', 'current', this.config.version].includes(path.basename(f.path))) return
if (['bin', 'current'].includes(path.basename(f.path))) return
// if 1.2.3-shasha7 starts with 1.2.3
if (path.basename(f.path).startsWith(this.config.version)) return
const mtime = f.stat.mtime
mtime.setHours(mtime.getHours() + (42 * 24))
if (mtime < new Date()) {
Expand Down

0 comments on commit ca57247

Please sign in to comment.