- 5종 약관(map/resourcepack/mod/installer/installer-rp) markdown 시드 + manifest/terms/ 노출 - 사이트 /op/agreement 목록 + Notion 스타일 markdown 에디터 (슬래시 명령어, 미리보기) - 메인 installer: 음악퀴즈 선택 직후 약관 동의 페이지(맵·모드·설치기) 추가 - rp installer: 음악퀴즈 선택 직후 약관 동의 페이지(리소스팩·설치기) 추가 - rp installer 취소 버그 수정: buildResourcepackZip 단계간 + archive.abort() 폴링 - rp installer 취소 UX: 즉시 "취소 중…" 표시, 취소 시 installFailed 알림 생략 - 0.2.6 → 0.3.0 (큰 기능) Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
46 lines
2.0 KiB
TypeScript
46 lines
2.0 KiB
TypeScript
import path from 'node:path'
|
|
import os from 'node:os'
|
|
|
|
// 컴파일 후 dist/shared/paths.js → 2단계 상위가 프로젝트 루트.
|
|
export const projectRoot = path.resolve(__dirname, '..', '..')
|
|
export const manifestRootPath = path.join(projectRoot, 'manifest.json')
|
|
export const manifestDirPath = path.join(projectRoot, 'manifest')
|
|
export const manifestTermsDirPath = path.join(manifestDirPath, 'terms')
|
|
export const accountFilePath = path.join(projectRoot, 'account.json')
|
|
export const fileDirPath = path.join(projectRoot, 'file')
|
|
export const fileListDirPath = path.join(fileDirPath, 'list')
|
|
export const fileDatapacksDirPath = path.join(fileDirPath, 'datapacks')
|
|
export const viewsDirPath = path.join(projectRoot, 'views')
|
|
export const publicDirPath = path.join(projectRoot, 'public')
|
|
|
|
/**
|
|
* 사용자 환경의 "%appdata%" 디렉터리(OS별 표준 사용자 데이터 경로)를 반환.
|
|
* - Windows : %APPDATA% (보통 C:\Users\<user>\AppData\Roaming)
|
|
* - macOS : ~/Library/Application Support
|
|
* - Linux 등 : $XDG_CONFIG_HOME 또는 ~/.config
|
|
*/
|
|
export function getAppDataDir(): string {
|
|
if (process.platform === 'win32') {
|
|
return process.env.APPDATA || path.join(os.homedir(), 'AppData', 'Roaming')
|
|
}
|
|
if (process.platform === 'darwin') {
|
|
return path.join(os.homedir(), 'Library', 'Application Support')
|
|
}
|
|
return process.env.XDG_CONFIG_HOME || path.join(os.homedir(), '.config')
|
|
}
|
|
|
|
/** %appdata%/.mc_custom — 음악퀴즈 관련 외부 도구/캐시 보관 디렉터리. */
|
|
export function getMcCustomDir(): string {
|
|
return path.join(getAppDataDir(), '.mc_custom')
|
|
}
|
|
|
|
/**
|
|
* %appdata%/.mc_custom/installer — 설치기가 자체적으로 다운로드해 사용하는
|
|
* 외부 바이너리(yt-dlp.exe, ffmpeg.exe 등) 보관 위치. .mc_custom 루트가
|
|
* 마인크래프트 게임 폴더(`mods/`, `resourcepacks/`, `saves/` 등)와 섞이지
|
|
* 않도록 별도 하위 폴더에 둔다.
|
|
*/
|
|
export function getMcCustomInstallerDir(): string {
|
|
return path.join(getMcCustomDir(), 'installer')
|
|
}
|