@aduh95/caritat-cli
Advanced tools
Comparing version 0.4.2 to 0.5.1
@@ -19,3 +19,3 @@ #!/usr/bin/env node | ||
}).argv; | ||
const { repo: repoUrl, branch, path: subPath } = parsedArgs; | ||
const { repo: repoURL, branch, path: subPath } = parsedArgs; | ||
const privateKey = parsedArgs.key === "-" | ||
@@ -26,3 +26,3 @@ ? await readStdIn(false) | ||
...(await getEnv(parsedArgs)), | ||
repoUrl, | ||
repoURL, | ||
branch, | ||
@@ -32,3 +32,3 @@ subPath, | ||
keyParts: parsedArgs["key-part"], | ||
firstCommitSha: parsedArgs.fromCommit, | ||
firstCommitRef: parsedArgs.fromCommit, | ||
mailmap: parsedArgs.mailmap, | ||
@@ -35,0 +35,0 @@ commitJsonSummary: null, |
@@ -123,12 +123,12 @@ #!/usr/bin/env node | ||
const protocol = parsedArgs.protocol ?? (data.viewer.publicKeys.totalCount ? "ssh" : "http"); | ||
function getHTTPRepoUrl(repoUrl, login) { | ||
const url = new URL(repoUrl + ".git"); | ||
function getHTTPRepoURL(repoURL, login) { | ||
const url = new URL(repoURL + ".git"); | ||
url.username = login; | ||
return url.toString(); | ||
} | ||
const repoUrl = protocol === "ssh" | ||
const repoURL = protocol === "ssh" | ||
? data.repository.sshUrl | ||
: getHTTPRepoUrl(data.repository.url, handle); | ||
: getHTTPRepoURL(data.repository.url, handle); | ||
console.warn("All relevant information has been retrieved:", { | ||
repoUrl, | ||
repoURL, | ||
branch, | ||
@@ -153,3 +153,3 @@ subPath, | ||
...(await getEnv(parsedArgs)), | ||
repoUrl, | ||
repoURL, | ||
branch, | ||
@@ -159,3 +159,3 @@ subPath, | ||
keyParts: parsedArgs["key-part"] ?? (await getKeyPartsFromComments()), | ||
firstCommitSha: sha, | ||
firstCommitRef: sha, | ||
mailmap: parsedArgs.mailmap, | ||
@@ -162,0 +162,0 @@ commitJsonSummary: parsedArgs["commit-json-summary"] |
@@ -0,1 +1,3 @@ | ||
import { once } from "node:events"; | ||
import { stdin, stdout } from "node:process"; | ||
import generateNewVoteFolder from "@aduh95/caritat/generateNewVoteFolder"; | ||
@@ -96,2 +98,18 @@ import parseArgs from "../utils/parseArgs.js"; | ||
await generateNewVoteFolder({ | ||
async askForConfirmation(ballotContent) { | ||
console.log("Here's how a ballot will look like:\n\n"); | ||
console.log(ballotContent); | ||
stdout.write("\nIs it ready to commit? [Y/n] "); | ||
stdin.resume(); | ||
let chars = await once(stdin, "data"); | ||
stdin.pause(); | ||
if (chars[0][0] === 0x6e || // n | ||
chars[0][0] === 0x4e // N | ||
) { | ||
console.log("Vote template file is ready for edit."); | ||
return true; | ||
} | ||
else | ||
return false; | ||
}, | ||
allowedVoters: parsedArgs["allowed-voter"], | ||
@@ -98,0 +116,0 @@ candidates: parsedArgs.candidate, |
@@ -101,12 +101,12 @@ #!/usr/bin/env node | ||
const protocol = parsedArgs.protocol ?? (data.viewer.publicKeys.totalCount ? "ssh" : "http"); | ||
function getHTTPRepoUrl(repoUrl, login) { | ||
const url = new URL(repoUrl + ".git"); | ||
function getHTTPRepoURL(repoURL, login) { | ||
const url = new URL(repoURL + ".git"); | ||
url.username = login; | ||
return url.toString(); | ||
} | ||
const repoUrl = protocol === "ssh" | ||
const repoURL = protocol === "ssh" | ||
? data.repository.sshUrl | ||
: getHTTPRepoUrl(data.repository.url, handle); | ||
: getHTTPRepoURL(data.repository.url, handle); | ||
console.log("All relevant information has been retrieved:", { | ||
repoUrl, | ||
repoURL, | ||
branch, | ||
@@ -118,3 +118,3 @@ subPath, | ||
...(await getEnv(parsedArgs)), | ||
repoUrl, | ||
repoURL, | ||
branch, | ||
@@ -121,0 +121,0 @@ subPath, |
@@ -5,8 +5,7 @@ #!/usr/bin/env node | ||
import { cliArgs, getEnv } from "../utils/voteGitEnv.js"; | ||
const parsedArgs = await parseArgs().options(cliArgs) | ||
.argv; | ||
const { repo: repoUrl, branch, path: subPath } = parsedArgs; | ||
const parsedArgs = await parseArgs().options(cliArgs).argv; | ||
const { repo: repoURL, branch, path: subPath } = parsedArgs; | ||
await voteUsingGit({ | ||
...(await getEnv(parsedArgs)), | ||
repoUrl, | ||
repoURL, | ||
branch, | ||
@@ -13,0 +12,0 @@ subPath, |
@@ -72,4 +72,4 @@ import { GitCliArgsType } from "../utils/cliArgsForGit.js"; | ||
abstain: boolean; | ||
signCommits: boolean; | ||
gpgSign: string | boolean; | ||
doNotCleanTempFiles: boolean; | ||
}>; |
@@ -60,5 +60,5 @@ import runChildProcessAsync from "../utils/runChildProcessAsync.js"; | ||
abstain: parsedArgs.abstain, | ||
signCommits: parsedArgs["gpg-sign"] === true, | ||
gpgSign: parsedArgs["gpg-sign"], | ||
doNotCleanTempFiles: parsedArgs["do-not-clean"], | ||
}; | ||
} |
{ | ||
"name": "@aduh95/caritat-cli", | ||
"version": "0.4.2", | ||
"version": "0.5.1", | ||
"files": [ | ||
@@ -13,3 +13,3 @@ "dist/" | ||
"dependencies": { | ||
"@aduh95/caritat": "0.4.2", | ||
"@aduh95/caritat": "0.5.1", | ||
"yargs": "^17.3.1" | ||
@@ -16,0 +16,0 @@ }, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
34922
1058
2
+ Added@aduh95/caritat@0.5.1(transitive)
+ Added@aduh95/caritat-crypto@0.5.1(transitive)
- Removed@aduh95/caritat@0.4.2(transitive)
- Removed@aduh95/caritat-crypto@0.4.2(transitive)
Updated@aduh95/caritat@0.5.1