Skip to content

Commit a5cff34

Browse files
committed
ui fixes
1 parent eb00f76 commit a5cff34

File tree

6 files changed

+27
-24
lines changed

6 files changed

+27
-24
lines changed

β€Žintegration-tests/happy-path-npm/__snapshots__/happy-path-npm.test.ts.snapβ€Ž

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@
33
exports[`Test happy-path-npm: making patch 1`] = `
44
"SNAPSHOT: making patch
55
patch-package 0.0.0
6-
βœ” Creating temporary folder
7-
βœ” Making tmp package.json
8-
βœ” Installing left-pad@1.1.3 with npm
9-
βœ” Diffing your files with clean files
6+
β€’ Creating temporary folder
7+
β€’ Installing left-pad@1.1.3 with npm
8+
β€’ Diffing your files with clean files
109
βœ” Created file patches/left-pad+1.1.3.patch
1110
END SNAPSHOT"
1211
`;

β€Žintegration-tests/happy-path-yarn/__snapshots__/happy-path-yarn.test.ts.snapβ€Ž

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@
33
exports[`Test happy-path-yarn: making patch 1`] = `
44
"SNAPSHOT: making patch
55
patch-package 0.0.0
6-
βœ” Creating temporary folder
7-
βœ” Making tmp package.json
8-
βœ” Installing left-pad@1.1.3 with yarn
9-
βœ” Diffing your files with clean files
6+
β€’ Creating temporary folder
7+
β€’ Installing left-pad@1.1.3 with yarn
8+
β€’ Diffing your files with clean files
109
βœ” Created file patches/left-pad+1.1.3.patch
1110
END SNAPSHOT"
1211
`;

β€Žintegration-tests/nested-packages/__snapshots__/nested-packages.test.ts.snapβ€Ž

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@
33
exports[`Test nested-packages: create the patch 1`] = `
44
"SNAPSHOT: create the patch
55
patch-package 0.0.0
6-
βœ” Creating temporary folder
7-
βœ” Making tmp package.json
8-
βœ” Installing string-width@2.1.1 with yarn
9-
βœ” Diffing your files with clean files
6+
β€’ Creating temporary folder
7+
β€’ Installing string-width@2.1.1 with yarn
8+
β€’ Diffing your files with clean files
109
βœ” Created file patches/wrap-ansi++string-width+2.1.1.patch
1110
END SNAPSHOT"
1211
`;

β€Žintegration-tests/nested-scoped-packages/__snapshots__/nested-scoped-packages.test.ts.snapβ€Ž

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@
33
exports[`Test nested-scoped-packages: create the patch 1`] = `
44
"SNAPSHOT: create the patch
55
patch-package 0.0.0
6-
βœ” Creating temporary folder
7-
βœ” Making tmp package.json
8-
βœ” Installing @types/angular@1.6.53 with yarn
9-
βœ” Diffing your files with clean files
6+
β€’ Creating temporary folder
7+
β€’ Installing @types/angular@1.6.53 with yarn
8+
β€’ Diffing your files with clean files
109
βœ” Created file patches/@microsoft+mezzurite-core++@types+angular+1.6.53.patch
1110
END SNAPSHOT"
1211
`;

β€Žsrc/index.tsβ€Ž

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,13 @@ import { join } from "./path"
1111

1212
const appPath = getAppRootPath()
1313
const argv = minimist(process.argv.slice(2), {
14-
boolean: ["use-yarn", "case-sensitive-path-filtering", "reverse"],
14+
boolean: [
15+
"use-yarn",
16+
"case-sensitive-path-filtering",
17+
"reverse",
18+
"help",
19+
"version",
20+
],
1521
string: ["patch-dir"],
1622
})
1723
const packageNames = argv._
@@ -22,7 +28,9 @@ console.log(
2228
require(join(__dirname, "../package.json")).version,
2329
)
2430

25-
if (argv.help || argv.h) {
31+
if (argv.version || argv.v) {
32+
// noop
33+
} else if (argv.help || argv.h) {
2634
printHelp()
2735
} else {
2836
if (packageNames.length) {

β€Žsrc/makePatch.tsβ€Ž

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { green } from "chalk"
1+
import { green, grey } from "chalk"
22
import { join, dirname, resolve } from "./path"
33
import { spawnSafeSync } from "./spawnSafe"
44
import { PackageManager } from "./detectPackageManager"
@@ -89,10 +89,9 @@ export const makePatch = (
8989
try {
9090
const patchesDir = join(appPath, patchDir)
9191

92-
console.info(green("βœ”"), "Creating temporary folder")
92+
console.info(grey("β€’"), "Creating temporary folder")
9393

9494
// make a blank package.json
95-
console.info(green("βœ”"), "Making tmp package.json")
9695
mkdirpSync(tmpRepoNpmRoot)
9796
writeFileSync(
9897
tmpRepoPackageJsonPath,
@@ -105,15 +104,15 @@ export const makePatch = (
105104

106105
if (packageManager === "yarn") {
107106
console.info(
108-
green("βœ”"),
107+
grey("β€’"),
109108
`Installing ${packageDetails.name}@${packageVersion} with yarn`,
110109
)
111110
spawnSafeSync(`yarn`, ["install", "--ignore-engines"], {
112111
cwd: tmpRepoNpmRoot,
113112
})
114113
} else {
115114
console.info(
116-
green("βœ”"),
115+
grey("β€’"),
117116
`Installing ${packageDetails.name}@${packageVersion} with npm`,
118117
)
119118
spawnSafeSync(`npm`, ["i"], { cwd: tmpRepoNpmRoot })
@@ -131,7 +130,7 @@ export const makePatch = (
131130
rimraf(join(tmpRepoPackagePath, "node_modules"))
132131

133132
// commit the package
134-
console.info(green("βœ”"), "Diffing your files with clean files")
133+
console.info(grey("β€’"), "Diffing your files with clean files")
135134
writeFileSync(join(tmpRepo.name, ".gitignore"), "!/node_modules\n\n")
136135
git("init")
137136
git("config", "--local", "user.name", "patch-package")

0 commit comments

Comments
Β (0)