Generate Super Mario War worlds from real-world data.
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 

29 行
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()