Skip to content

Commit 948c734

Browse files
authored
Merge pull request #1471 from endojs/kris-fix-hash-map-hash-archive
fix(cli): Fix hash, map, and hash-archive commands
2 parents 768a03a + 2a0a312 commit 948c734

File tree

1 file changed

+18
-24
lines changed

1 file changed

+18
-24
lines changed

packages/cli/src/endo.js

Lines changed: 18 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -135,32 +135,26 @@ export const main = async rawArgs => {
135135
process.stderr.write('ok\n');
136136
});
137137

138-
program
139-
.command('map <application-path>')
140-
.action(async (_cmd, [applicationPath]) => {
141-
const applicationLocation = url.pathToFileURL(applicationPath);
142-
const compartmentMapBytes = await mapLocation(
143-
readPowers,
144-
applicationLocation,
145-
);
146-
process.stdout.write(compartmentMapBytes);
147-
});
138+
program.command('map <application-path>').action(async applicationPath => {
139+
const applicationLocation = url.pathToFileURL(applicationPath);
140+
const compartmentMapBytes = await mapLocation(
141+
readPowers,
142+
applicationLocation,
143+
);
144+
process.stdout.write(compartmentMapBytes);
145+
});
148146

149-
program
150-
.command('hash <application-path>')
151-
.action(async (_cmd, [applicationPath]) => {
152-
const applicationLocation = url.pathToFileURL(applicationPath);
153-
const sha512 = await hashLocation(readPowers, applicationLocation);
154-
process.stdout.write(`${sha512}\n`);
155-
});
147+
program.command('hash <application-path>').action(async applicationPath => {
148+
const applicationLocation = url.pathToFileURL(applicationPath);
149+
const sha512 = await hashLocation(readPowers, applicationLocation);
150+
process.stdout.write(`${sha512}\n`);
151+
});
156152

157-
program
158-
.command('hash-archive <archive-path>')
159-
.action(async (_cmd, [archivePath]) => {
160-
const archiveLocation = url.pathToFileURL(archivePath);
161-
const { sha512 } = await loadArchive(readPowers, archiveLocation);
162-
process.stdout.write(`${sha512}\n`);
163-
});
153+
program.command('hash-archive <archive-path>').action(async archivePath => {
154+
const archiveLocation = url.pathToFileURL(archivePath);
155+
const { sha512 } = await loadArchive(readPowers, archiveLocation);
156+
process.stdout.write(`${sha512}\n`);
157+
});
164158

165159
program
166160
.command('archive <archive-path> <application-path>')

0 commit comments

Comments
 (0)