@team-semicolon/semo-cli 3.0.14 → 3.0.15
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/dist/index.js +15 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -110,6 +110,21 @@ const isWindows = os.platform() === "win32";
|
|
|
110
110
|
* Junction은 관리자 권한 없이 디렉토리 링크를 생성할 수 있음
|
|
111
111
|
*/
|
|
112
112
|
function createSymlinkOrJunction(targetPath, linkPath) {
|
|
113
|
+
// 이미 존재하는 링크/파일 제거 (깨진 심볼릭 링크도 처리)
|
|
114
|
+
try {
|
|
115
|
+
const stats = fs.lstatSync(linkPath);
|
|
116
|
+
if (stats.isSymbolicLink() || stats.isFile() || stats.isDirectory()) {
|
|
117
|
+
try {
|
|
118
|
+
fs.unlinkSync(linkPath);
|
|
119
|
+
}
|
|
120
|
+
catch {
|
|
121
|
+
removeRecursive(linkPath);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
catch {
|
|
126
|
+
// 파일이 존재하지 않음 - 정상
|
|
127
|
+
}
|
|
113
128
|
if (isWindows) {
|
|
114
129
|
// Windows: Junction 사용 (절대 경로 필요)
|
|
115
130
|
const absoluteTarget = path.resolve(targetPath);
|