Skip to content

Commit

Permalink
Be sure lang-server folder is cleaned when building (#1719)
Browse files Browse the repository at this point in the history
  • Loading branch information
StephenWeatherford authored Jun 27, 2024
1 parent 1810b63 commit 1de6ec9
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions gulpfile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,8 @@ async function getLanguageServer(): Promise<void> {
'install',
languageServerNugetPackage,
'-Framework', `net${langServerDotnetVersion}`,
'-OutputDirectory', 'pkgs',
//'-Verbosity', 'detailed',
'-OutputDirectory', pkgsPath,
'-Verbosity', 'detailed',
'-ExcludeVersion', // Keeps the package version from being included in the output folder name
'-NonInteractive',
'-ConfigFile', configPath
Expand All @@ -251,20 +251,24 @@ async function getLanguageServer(): Promise<void> {
args.unshift('nuget.exe');
}
const command = `${app} ${args.join(' ')}`;
const languageServerPackageFolderName = path.join(pkgsPath, languageServerNugetPackage);
console.log(`Deleting ${languageServerPackageFolderName}`);
rimraf.sync(languageServerPackageFolderName);
executeInShell(command);
fse.unlinkSync(configPath);

// Copy binaries and license into dist\languageServer
console.log(`Removing ${languageServerFolderName}`);
rimraf.sync(languageServerFolderName);
console.log(`Deleting ${destPath}`);
rimraf.sync(destPath);

console.log(`Copying language server binaries to ${languageServerFolderName}`);
const langServerSourcePath = path.join(pkgsPath, languageServerNugetPackage, 'lib', `net${langServerDotnetVersion}`);
const licenseSourcePath = path.join(pkgsPath, languageServerNugetPackage, languageServerLicenseFileName);

fse.mkdirpSync(destPath);
console.log(` ${langServerSourcePath} -> ${destPath}`);
copyFolder(langServerSourcePath, destPath);

const licenseSourcePath = path.join(pkgsPath, languageServerNugetPackage, languageServerLicenseFileName);
const licenseDest = path.join(languageServerFolderName, languageServerLicenseFileName);
console.log(`Copying language server license ${licenseSourcePath} to ${licenseDest}`);
fse.copyFileSync(licenseSourcePath, licenseDest);
Expand Down

0 comments on commit 1de6ec9

Please sign in to comment.