INNER CODE UNIT · JavaScript

writeUtf8File

GDevelopApp/GDevelop-extensions · scripts/compile-translations.js:36

const writeUtf8File = (path, content) =>
  new Promise((resolve, reject) => {
    fs.writeFile(path, content, 'utf8', function (err) {
      if (err) {
        return reject(err);
      }

      resolve();
    });
  });

// Identify where msgcat is on the system
let msgcat = '';
msgcat = shell.exec('which msgcat 2>/dev/null', { silent: true }).stdout;
if (!msgcat) {
  msgcat = shell.exec('find /usr -name "msgcat" -print -quit 2>/dev/null', {
    silent: true,
  }).stdout;

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…