Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "create-symlink-target",
"private": true,
"packageManager": "pnpm@11.24.0"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import fs from 'node:fs';
import path from 'node:path';

const destination = path.resolve('linked-directory');
if (process.argv[2] !== 'dangling') {
fs.mkdirSync(destination);
fs.writeFileSync(path.join(destination, 'keep.txt'), 'keep\n');
}
fs.symlinkSync(destination, 'new-project', process.platform === 'win32' ? 'junction' : 'dir');
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[[case]]
name = "create_symlink_target_destination"
vp = "local"
comment = "The overwrite prompt shows the link destination even with a trailing separator; cancellation preserves the link and its contents."
steps = [
{ argv = ["node", "setup.mjs"], snapshot = false },
{ argv = ["vp", "create", "vite:application", "--directory", "new-project/", "--interactive", "--no-agent", "--no-editor", "--no-git", "--no-hooks"], interactions = [
{ "expect-milestone" = "select:select:0" },
{ "write-key" = "enter" },
] },
["vpt", "stat-file", "new-project", "--assert", "symlink"],
["vpt", "print-file", "linked-directory/keep.txt"],
]

[[case]]
name = "create_dangling_symlink_target_destination"
vp = "local"
comment = "A missing link destination is still shown in the overwrite prompt; cancellation preserves the dangling link."
steps = [
{ argv = ["node", "setup.mjs", "dangling"], snapshot = false },
{ argv = ["vp", "create", "vite:application", "--directory", "new-project", "--interactive", "--no-agent", "--no-editor", "--no-git", "--no-hooks"], interactions = [
{ "expect-milestone" = "select:select:0" },
{ "write-key" = "enter" },
] },
["vpt", "stat-file", "new-project", "--assert", "symlink"],
["vpt", "stat-file", "linked-directory", "--assert", "missing"],
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# create_dangling_symlink_target_destination

A missing link destination is still shown in the overwrite prompt; cancellation preserves the dangling link.

## `node setup.mjs dangling`


## `vp create vite:application --directory new-project --interactive --no-agent --no-editor --no-git --no-hooks`

**→ expect-milestone:** `select:select:0`

```
VITE+ - The Unified Toolchain for the Web

› Target path "<workspace>/new-project" is a symbolic link to "<workspace>/linked-directory". Please choose how to proceed:
› Cancel operation
Remove symbolic link and continue
↑/↓ navigate · Enter confirm
```

**← write-key:** `enter`

```
VITE+ - The Unified Toolchain for the Web

◇ Target path "<workspace>/new-project" is a symbolic link to "<workspace>/linked-directory". Please choose how to proceed:
Cancel operation

Operation cancelled
```

## `vpt stat-file new-project --assert symlink`

```
new-project: symlink
```

## `vpt stat-file linked-directory --assert missing`

```
linked-directory: missing
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# create_symlink_target_destination

The overwrite prompt shows the link destination even with a trailing separator; cancellation preserves the link and its contents.

## `node setup.mjs`


## `vp create vite:application --directory new-project/ --interactive --no-agent --no-editor --no-git --no-hooks`

**→ expect-milestone:** `select:select:0`

```
VITE+ - The Unified Toolchain for the Web

› Target path "<workspace>/new-project" is a symbolic link to "<workspace>/linked-directory". Please choose how to proceed:
› Cancel operation
Remove symbolic link and continue
↑/↓ navigate · Enter confirm
```

**← write-key:** `enter`

```
VITE+ - The Unified Toolchain for the Web

◇ Target path "<workspace>/new-project" is a symbolic link to "<workspace>/linked-directory". Please choose how to proceed:
Cancel operation

Operation cancelled
```

## `vpt stat-file new-project --assert symlink`

```
new-project: symlink
```

## `vpt print-file linked-directory/keep.txt`

```
keep
```
Loading
Loading