Skip to content

Commit

Permalink
Added copy support for non deck users
Browse files Browse the repository at this point in the history
  • Loading branch information
CEbbinghaus committed Sep 22, 2024
1 parent 6fa1181 commit 3ffc23c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions util/build.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,15 @@ if (tasks.includes('collect')) {
copyFileSync('package.json', 'build/package.json');
}

const is_local = existsSync('/home/deck/homebrew');
const current_user = execSync("whoami").toString().trim();

const is_local = existsSync(`/home/${current_user}/homebrew`);

if (is_local && tasks.includes('copy')) {
Logger.Log('Copying build folder to local plugin directory');
execSync(`sudo rm -rf /home/deck/homebrew/plugins/${PluginName}`);
execSync(`sudo cp -r build/ /home/deck/homebrew/plugins/${PluginName}`);
execSync(`sudo chmod 555 /home/deck/homebrew/plugins/${PluginName}`);
execSync(`sudo rm -rf /home/${current_user}/homebrew/plugins/${PluginName}`);
execSync(`sudo cp -r build/ /home/${current_user}/homebrew/plugins/${PluginName}`);
execSync(`sudo chmod 555 /home/${current_user}/homebrew/plugins/${PluginName}`);
} else {
if (!tasks.includes('copy')) {
Logger.Log('Skipping copying build folder to local plugin directory');
Expand Down

0 comments on commit 3ffc23c

Please sign in to comment.