dotmd-cli 0.71.0 → 0.71.2
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/git.mjs +11 -1
- package/src/new.mjs +1 -0
package/package.json
CHANGED
package/src/git.mjs
CHANGED
|
@@ -596,7 +596,17 @@ function prepareMoveIndex(source, target, repoRoot, before, options = {}) {
|
|
|
596
596
|
}
|
|
597
597
|
testHooks.beforeGitIndexPrepare?.({ preparedPath, before, prepared: seed });
|
|
598
598
|
const env = { ...process.env, GIT_INDEX_FILE: preparedPath };
|
|
599
|
-
|
|
599
|
+
// A tracked source relocating into an ignored destination is exactly what
|
|
600
|
+
// `git mv` permits: ignore patterns govern NEW untracked paths, not the
|
|
601
|
+
// relocation of content git already tracks. Bare `git add` doesn't make that
|
|
602
|
+
// distinction and refuses ("paths are ignored by one of your .gitignore
|
|
603
|
+
// files"), which failed the whole transaction and rolled the move back — so
|
|
604
|
+
// `dotmd archive` was unusable in any repo that gitignores its docs root
|
|
605
|
+
// while force-tracking the docs inside it. Force only when the source was
|
|
606
|
+
// tracked; an untracked source stays subject to the ignore.
|
|
607
|
+
const sourceTracked = isTracked(paths[0], repoRoot);
|
|
608
|
+
const addArgs = sourceTracked ? ['add', '-f', '-A', '--', paths[1]] : ['add', '-A', '--', paths[1]];
|
|
609
|
+
const result = spawnSync('git', addArgs, {
|
|
600
610
|
cwd: repoRoot,
|
|
601
611
|
encoding: 'utf8',
|
|
602
612
|
env,
|
package/src/new.mjs
CHANGED
|
@@ -278,6 +278,7 @@ function mergeBodyFrontmatter(scaffoldFm, overrides, cliType) {
|
|
|
278
278
|
// consulted after existsSync fails, so a real file by any of these names wins.
|
|
279
279
|
const BODY_PLACEHOLDER_NAMES = new Set([
|
|
280
280
|
'draft', 'draft.md', '/tmp/draft.md', 'tmp/draft.md',
|
|
281
|
+
'/tmp/baton.md', '/tmp/my-draft.md',
|
|
281
282
|
'path', 'file', 'body', 'FILE', 'PATH', 'BODY',
|
|
282
283
|
]);
|
|
283
284
|
|