Generate Super Mario War worlds from real-world data.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

29 lines
695 B

  1. import * as fs from 'fs/promises';
  2. import * as path from 'path';
  3. const linkGfx = async () => {
  4. const target = path.resolve('../../data/gfx/packs/Classic/world/preview');
  5. const link = path.resolve('./src/assets/gfx')
  6. process.stdout.write(`Making link:\n${link} -> ${target}\n`);
  7. try {
  8. await fs.stat(link)
  9. process.stdout.write('Link exists. Overwriting...\n');
  10. await fs.unlink(link)
  11. } catch (e) {
  12. // noop
  13. }
  14. try {
  15. await fs.symlink(target, link, 'dir');
  16. process.stdout.write('Link created.\n');
  17. } catch (err) {
  18. console.log(err);
  19. process.stderr.write('Cannot create link.\n')
  20. process.exit(1);
  21. return;
  22. }
  23. process.exit(0);
  24. }
  25. void linkGfx()