Skip to content

Commit

Permalink
feat: allow to override slot
Browse files Browse the repository at this point in the history
  • Loading branch information
belopash committed Sep 8, 2024
1 parent 3d6e68c commit e5bd1d6
Show file tree
Hide file tree
Showing 2 changed files with 8 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.1",
"version": "2.0.0-beta.2",
"homepage": "https://www.subsquid.io",
"repository": "https://github.com/subsquid/manifest.git",
"license": "GPL-3.0-or-later",
Expand Down
8 changes: 7 additions & 1 deletion src/manifest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -300,13 +300,19 @@ export class Manifest {
}
}

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

if (name) {
manifest.name = name;
}

if (slot) {
manifest.slot = slot;
delete manifest.tag;
delete manifest.version;
}

return yaml.dump(manifest, {
lineWidth: -1,
styles: {
Expand Down

0 comments on commit e5bd1d6

Please sign in to comment.