Skip to content

Commit

Permalink
fix: sync file wrong path
Browse files Browse the repository at this point in the history
  • Loading branch information
louis-menlo committed Dec 28, 2023
1 parent 96c01d4 commit 7ae3948
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions electron/handlers/download.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,11 @@ export function handleDownloaderIPCs() {
*/
ipcMain.handle(DownloadRoute.downloadFile, async (_event, url, fileName) => {
const userDataPath = join(app.getPath('home'), 'jan')
if (typeof fileName === 'string' && fileName.includes('file:/')) {
fileName = fileName.replace('file:/', '')
if (
typeof fileName === 'string' &&
(fileName.includes('file:/') || fileName.includes('file:\\'))
) {
fileName = fileName.replace('file:/', '').replace('file:\\', '')
}
const destination = resolve(userDataPath, fileName)
const rq = request(url)
Expand Down
2 changes: 1 addition & 1 deletion extensions/inference-triton-trtllm-extension/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import { EngineSettings } from "./@types/global";
export default class JanInferenceTritonTrtLLMExtension
implements InferenceExtension
{
private static readonly _homeDir = "engines";
private static readonly _homeDir = "file://engines";
private static readonly _engineMetadataFileName = "triton_trtllm.json";

static _currentModel: Model;
Expand Down
2 changes: 1 addition & 1 deletion extensions/model-extension/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export default class JanModelExtension implements ModelExtension {
const srcPath = await joinPath([resourePath, 'models'])

const userSpace = await getUserSpace()
const destPath = await joinPath([userSpace, JanModelExtension._homeDir])
const destPath = await joinPath([userSpace, 'models'])

await fs.syncFile(srcPath, destPath)

Expand Down

0 comments on commit 7ae3948

Please sign in to comment.