Skip to content

Commit

Permalink
chore(menuv): move into external lib folder to build dir
Browse files Browse the repository at this point in the history
Former-commit-id: 90c96239f33b3bd1f0a999e3de782892e4d8acea
  • Loading branch information
sebastiendeu authored and joelwurtz committed Jan 8, 2022
1 parent 7428c4b commit 7211525
Show file tree
Hide file tree
Showing 44 changed files with 3,494 additions and 15 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
16 changes: 9 additions & 7 deletions resources/[lib]/menuv/build.js → lib/menuv/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,18 @@ const DEBUG = {

const PATHS = {
SOURCE: path.resolve(`${__dirname}/source`),
BUILD: path.resolve(`${__dirname}/../../resources/[lib]/menuv`),
APP: path.resolve(`${__dirname}/source/app`),
MENUV: path.resolve(`${__dirname}/source/menuv.lua`)
}

const COPY_FILES = [
{ from: `${PATHS.APP}/menuv.lua`, to: `${__dirname}/menuv/menuv.lua`, type: 'file' },
{ from: `${__dirname}/source/config.lua`, to: `${__dirname}/config.lua`, type: 'file' },
{ from: `${__dirname}/templates/menuv.ytd`, to: `${__dirname}/stream/menuv.ytd`, type: 'file' },
{ from: `${__dirname}/source/languages`, to: `${__dirname}/languages`, type: 'dir' },
{ from: `${PATHS.APP}/lua_components`, to: `${__dirname}/menuv/components`, type: 'dir' }
{ from: `${PATHS.APP}/menuv.lua`, to: `${PATHS.BUILD}/menuv/menuv.lua`, type: 'file' },
{ from: `${PATHS.APP}/fxmanifest.lua`, to: `${PATHS.BUILD}/fxmanifest.lua`, type: 'file' },
{ from: `${__dirname}/source/config.lua`, to: `${PATHS.BUILD}/config.lua`, type: 'file' },
{ from: `${__dirname}/source/languages`, to: `${PATHS.BUILD}/languages`, type: 'dir' },
{ from: `${__dirname}/dist`, to: `${PATHS.BUILD}/dist`, type: 'dir', deleteAfter: true },
{ from: `${PATHS.APP}/lua_components`, to: `${PATHS.BUILD}/menuv/components`, type: 'dir' }
];

DEBUG.PRINT(`Building ${colors.yellow('MenuV')} ...`)
Expand Down Expand Up @@ -124,7 +126,7 @@ exec(`npx webpack${argumentString}`, (err, stdout, stderr) => {
});
}

const final_menuv_path = path.resolve(`${__dirname}/menuv.lua`);
const final_menuv_path = path.resolve(`${PATHS.BUILD}/menuv.lua`);

fs.writeFileSync(final_menuv_path, menuv_file);

Expand All @@ -136,6 +138,6 @@ exec(`npx webpack${argumentString}`, (err, stdout, stderr) => {
fs.writeFileSync(file, file_content);
}

DEBUG.PRINT(`${colors.yellow('MenuV')} successfully build\n${colors.bold('Location: ')} ${__dirname}`);
DEBUG.PRINT(`${colors.yellow('MenuV')} successfully build`);
});
});
Loading

0 comments on commit 7211525

Please sign in to comment.