signing-enclave
Version:
A code signing and notarization tool for macOS and Windows applications. Uses Azure Key Vault for secret and certificate management.
50 lines • 2.14 kB
JavaScript
;
// src/commands/watch-receipts.ts
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.watchReceiptsCommand = void 0;
const commander_1 = require("commander");
const path_1 = __importDefault(require("path"));
const receiptWatcher_1 = require("../receiptWatcher");
exports.watchReceiptsCommand = new commander_1.Command("watch-receipts")
.description("Start watching receipts for updates")
.option("-r, --receipts <path>", "Path to the receipts folder", "./receipts")
.action(async (options) => {
const receiptsFolder = path_1.default.resolve(process.cwd(), options.receipts);
// Initialize the receipt watcher
const watcher = (0, receiptWatcher_1.receiptWatcher)(receiptsFolder);
// Register event listeners
watcher.on("file-added", (receipt) => {
console.log(`Event: file-added | Receipt ID: ${receipt.id} | File: ${receipt.originalFile}`);
});
watcher.on("file-signed", (receipt) => {
console.log(`Event: file-signed | Receipt ID: ${receipt.id} | File: ${receipt.originalFile}`);
});
watcher.on("file-notarized", (receipt) => {
console.log(`Event: file-notarized | Receipt ID: ${receipt.id} | File: ${receipt.originalFile}`);
});
watcher.on("file-completed", (receipt) => {
console.log(`Event: file-completed | Receipt ID: ${receipt.id} | File: ${receipt.originalFile}`);
});
watcher.on("all-files-signed", () => {
console.log("Event: all-files-signed");
});
watcher.on("all-files-completed", () => {
console.log("Event: all-files-completed");
});
// Start the watcher
watcher.start();
// Keep the process alive
process.stdin.resume();
// Handle graceful shutdown
const shutdown = () => {
console.log("\nShutting down receipt watcher...");
watcher.stop();
process.exit();
};
process.on("SIGINT", shutdown);
process.on("SIGTERM", shutdown);
});
//# sourceMappingURL=watch-receipts.js.map