Skip to content

Commit

Permalink
Hard link debug
Browse files Browse the repository at this point in the history
  • Loading branch information
hoontee committed Dec 16, 2024
1 parent 1eddc19 commit 44c7665
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Binary file modified Lync/Plugin.rbxm
Binary file not shown.
8 changes: 8 additions & 0 deletions Lync/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1292,24 +1292,28 @@ async function fetchSources() {
hardLinkPaths = []
if (PLATFORM == 'windows' || PLATFORM == 'linux') {
const versionsPath = path.resolve(PLATFORM == 'windows' && CONFIG.Path_RobloxVersions.replace('%LOCALAPPDATA%', process.env.LOCALAPPDATA) || CONFIG.Path_RobloxVersions)
if (DEBUG) console.log('Searching:', cyan(versionsPath))
fs.readdirSync(versionsPath).forEach((dirNext) => {
const stats = fs.statSync(path.resolve(versionsPath, dirNext))
if (stats.isDirectory() && fs.existsSync(path.resolve(versionsPath, dirNext, 'RobloxStudioBeta.exe'))) {
const hardLinkPath = path.resolve(versionsPath, dirNext, 'content/lync')
if (!fs.existsSync(hardLinkPath)) {
fs.mkdirSync(hardLinkPath)
}
if (DEBUG) console.log('Studio path found:', cyan(hardLinkPath))
hardLinkPaths.push(hardLinkPath)
}
})
if (PLATFORM == 'windows') {
// Studio Mod Manager
const modManagerContentPath = path.resolve(CONFIG.Path_StudioModManagerContent.replace('%LOCALAPPDATA%', process.env.LOCALAPPDATA))
if (DEBUG) console.log('Searching:', cyan(modManagerContentPath))
if (fs.existsSync(modManagerContentPath)) {
const hardLinkPath = path.resolve(modManagerContentPath, 'lync')
if (!fs.existsSync(hardLinkPath)) {
fs.mkdirSync(hardLinkPath)
}
if (DEBUG) console.log('Studio Mod Manager path found:', cyan(hardLinkPath))
hardLinkPaths.push(hardLinkPath)
}
}
Expand All @@ -1322,8 +1326,12 @@ async function fetchSources() {
hardLinkPaths.push(hardLinkPath)
}
for (const hardLinkPath of hardLinkPaths) {
if (DEBUG) console.log('Linking', cyan(process.cwd()), '->', cyan(hardLinkPath))
hardLinkRecursive(process.cwd(), hardLinkPath)
}
if (hardLinkPaths.length == 0) {
console.error(red('No hard link paths found'))
}

// Send map
const mapJsonString = JSON.stringify(map)
Expand Down

0 comments on commit 44c7665

Please sign in to comment.