Skip to content

Commit

Permalink
feat: allow to replace tag
Browse files Browse the repository at this point in the history
  • Loading branch information
belopash committed Sep 16, 2024
1 parent ede13a9 commit 23ea85a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@subsquid/manifest",
"type": "commonjs",
"version": "2.0.0-beta.3",
"version": "2.0.0-beta.4",
"homepage": "https://www.subsquid.io",
"repository": "https://github.com/subsquid/manifest.git",
"license": "GPL-3.0-or-later",
Expand Down
6 changes: 5 additions & 1 deletion src/manifest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ export class Manifest {
}
}

static replace(str: string, { name, slot }: { name?: string; slot?: string }) {
static replace(str: string, { name, slot, tag }: { name?: string; slot?: string; tag?: string }) {
const manifest = yaml.load(str) as Partial<ManifestValue>;

if (name) {
Expand All @@ -311,6 +311,10 @@ export class Manifest {
manifest.slot = slot;
delete manifest.tag;
delete manifest.version;
} else if (tag) {
manifest.tag = tag;
delete manifest.slot;
delete manifest.version;
}

return yaml.dump(manifest, {
Expand Down

0 comments on commit 23ea85a

Please sign in to comment.