Skip to content

Commit

Permalink
Merge remote-tracking branch 'my/yaro/registry-prompt' into yaro/regi…
Browse files Browse the repository at this point in the history
…stry-prompt
  • Loading branch information
YaroShkvorets committed Dec 10, 2024
2 parents aa2bd67 + 1d53441 commit a88bce0
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion packages/cli/src/command-helpers/file-resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export async function resolveFile(

throw new Error('Invalid file source. Must be a file path, IPFS hash, or URL');
} catch (error) {
await cleanup();
cleanup();
throw error;
}
};
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/command-helpers/prompt-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export class PromptManager {
}
if (isCtrlC || this.currentStep === 0) {
process.stdout.write('\n');
process.exit(0);
process.exit(1);
}

this.currentStep--;
Expand Down
4 changes: 1 addition & 3 deletions packages/cli/src/command-helpers/scaffold.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,8 @@ const writeScaffoldDirectory = async (scaffold: any, directory: string, spinner:
const filename = path.join(directory, basename);

// Write file or recurse into subdirectory
if (typeof content === 'string') {
if (typeof content === 'string' || Buffer.isBuffer(content)) {
await fs.writeFile(filename, content, 'utf-8');
} else if (Buffer.isBuffer(content)) {
await fs.writeFile(filename, content);
} else if (content == null) {
return; // continue loop
} else {
Expand Down
6 changes: 2 additions & 4 deletions packages/cli/src/commands/add.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,8 @@ export default class AddCommand extends Command {
let contractService: ContractService | undefined;

if (isLocalHost) this.warn('`localhost` network detected, prompting user for inputs');
else {
const registry = await loadRegistry();
contractService = new ContractService(registry);
}
const registry = await loadRegistry();
contractService = new ContractService(registry);

Check failure on line 81 in packages/cli/src/commands/add.ts

View workflow job for this annotation

GitHub Actions / Lint

'contractService' is never reassigned. Use 'const' instead

let startBlock = startBlockFlag;
let contractName = contractNameFlag;
Expand Down

0 comments on commit a88bce0

Please sign in to comment.