mirror of
https://github.com/HeyPuter/puter.git
synced 2026-05-04 00:20:45 +00:00
add support for building with custom icons (#2635)
This commit is contained in:
committed by
GitHub
parent
c9787c1d4b
commit
c297715875
+19
-1
@@ -17,5 +17,23 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import { build } from './utils.js';
|
||||
import { hideBin } from 'yargs/helpers';
|
||||
import yargs from 'yargs';
|
||||
import fs from 'node:fs';
|
||||
import { execSync } from 'node:child_process';
|
||||
import { Buffer } from 'node:buffer';
|
||||
|
||||
build();
|
||||
// eslint-disable-next-line no-undef
|
||||
const argv = yargs(hideBin(process.argv)).parse();
|
||||
if ( argv.icons_url ) {
|
||||
console.log('Extracting icons...');
|
||||
const iconsTar = Buffer.from(await fetch(argv.icons_url).then(r => r.arrayBuffer()));
|
||||
await fs.promises.writeFile('icons.tar.gz', iconsTar);
|
||||
if ( fs.existsSync('src/icons') ) {
|
||||
fs.promises.rename('src/icons', 'src/icons.old');
|
||||
}
|
||||
execSync('tar -xzvf icons.tar.gz');
|
||||
fs.promises.rm('icons.tar.gz');
|
||||
}
|
||||
|
||||
build();
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
icons.old/
|
||||
Reference in New Issue
Block a user