relacher 0.0.7-rc.2 → 0.0.7-rc.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/prepare.ts +2 -3
- package/src/vcs/common.ts +12 -2
package/package.json
CHANGED
package/src/prepare.ts
CHANGED
|
@@ -183,9 +183,8 @@ export function prepare(
|
|
|
183
183
|
if (typeof vcs.isTracked === 'function') {
|
|
184
184
|
const filtered: PackageConfig[] = [];
|
|
185
185
|
for (const pkg of packages) {
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
: path.resolve(cwd, pkg.watch?.[0] || '.');
|
|
186
|
+
// Use relative path directly rather than resolving to absolute
|
|
187
|
+
const targetPath = pkg.manifestPath || pkg.watch?.[0] || '.';
|
|
189
188
|
|
|
190
189
|
const isTracked = yield* vcs.isTracked(targetPath);
|
|
191
190
|
if (isTracked) {
|
package/src/vcs/common.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { execFileSync } from 'node:child_process';
|
|
2
|
+
import path from 'node:path';
|
|
2
3
|
|
|
3
4
|
export function isInsideGitWorkTree(cwd: string): boolean {
|
|
4
5
|
try {
|
|
@@ -14,7 +15,11 @@ export function isInsideGitWorkTree(cwd: string): boolean {
|
|
|
14
15
|
|
|
15
16
|
export function isGitTracked(filePath: string, cwd: string): boolean {
|
|
16
17
|
try {
|
|
17
|
-
|
|
18
|
+
const relPath = path.isAbsolute(filePath)
|
|
19
|
+
? path.relative(cwd, filePath).replace(/\\/g, '/')
|
|
20
|
+
: filePath.replace(/\\/g, '/');
|
|
21
|
+
|
|
22
|
+
execFileSync('git', ['ls-files', '--error-unmatch', relPath || '.'], {
|
|
18
23
|
cwd,
|
|
19
24
|
stdio: ['ignore', 'ignore', 'ignore'],
|
|
20
25
|
});
|
|
@@ -38,7 +43,12 @@ export function isInsideJjWorkTree(cwd: string): boolean {
|
|
|
38
43
|
|
|
39
44
|
export function isJjTracked(filePath: string, cwd: string): boolean {
|
|
40
45
|
try {
|
|
41
|
-
|
|
46
|
+
// Jujutsu requires relative paths from cwd:
|
|
47
|
+
const relPath = path.isAbsolute(filePath)
|
|
48
|
+
? path.relative(cwd, filePath).replace(/\\/g, '/')
|
|
49
|
+
: filePath.replace(/\\/g, '/');
|
|
50
|
+
|
|
51
|
+
const out = execFileSync('jj', ['--color=never', 'files', relPath || '.'], {
|
|
42
52
|
cwd,
|
|
43
53
|
encoding: 'utf8',
|
|
44
54
|
stdio: ['ignore', 'pipe', 'ignore'],
|