Skip to content

Commit

Permalink
fix: homedir + webpack local
Browse files Browse the repository at this point in the history
  • Loading branch information
moshfeu committed Apr 25, 2021
1 parent 9fa486d commit 0d06445
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/services/path.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { join } from 'path';
import { mkdirSync, existsSync, readdirSync } from 'fs';
import { findArgument } from './additional-arguments';
import { homedir } from 'os';

function downloadsFolder() {
return join(process.env.HOME, 'downloads');
return join(homedir(), 'downloads');
}

const folderName = 'y2mp3';
Expand Down
9 changes: 5 additions & 4 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,14 @@ module.exports = (env, argv) => ({
// });
let firstTime = true;
compiler.hooks.done.tap('ts', () => {
console.log('after compile');
spawnSync('tsc', {
console.log(`after compile in mode "${compiler.options.mode}"`);
spawnSync('tsc', ['--project', `tsconfig${compiler.options.mode === 'production' ? '.prod' : ''}.json`], {
stdio: 'inherit'
});
console.log('after tsc');
if (firstTime && argv.mode === 'development') {
console.log(`after tsc. first time? ${firstTime}`);
if (firstTime && compiler.options.mode === 'development') {
firstTime = false;
console.log('run electron')
spawnSync('yarn', ['electron'], {
stdio: 'inherit'
});
Expand Down

0 comments on commit 0d06445

Please sign in to comment.