How to use the gluegun.filesystem.read function in gluegun

To help you get started, we’ve selected a few gluegun examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github SplitmediaLabsLimited / devctl / src / commands / compile.js View on Github external
...finalDockerCompose,
        ...compose,
      };

      if (!dotenv) {
        return;
      }

      const dotenvPath = filesystem.resolve(path, '.env');

      let finalDotEnv = {};

      const exists = await filesystem.exists(dotenvPath);

      if (exists) {
        const raw = await filesystem.read(dotenvPath);
        finalDotEnv = parseEnv(raw);
      }

      finalDotEnv = {
        ...finalDotEnv,
        ...dotenv,
      };

      await filesystem.write(dotenvPath, stringifyToEnv(finalDotEnv));
    });
github SplitmediaLabsLimited / devctl / src / commands / compile.js View on Github external
})
        .filter(i => !!i)
        .forEach(proxies => {
          proxies.forEach(proxy => {
            const { port, protocol = 'http', paths } = proxy;

            paths.forEach(path => {
              routes[path] = `${protocol}://${dockerhost}:${port}`;
            });
          });
        });

      const proxy = get('proxy');

      if (get('proxy.ssl.key')) {
        proxy.ssl.key = await filesystem.read(
          filesystem.resolve(get('cwd'), get('proxy.ssl.key'))
        );
      }

      if (get('proxy.ssl.cert')) {
        proxy.ssl.cert = await filesystem.read(
          filesystem.resolve(get('cwd'), get('proxy.ssl.cert'))
        );
      }

      const httpPort = get('proxy.httpPort', 80);

      const environment = {
        DEVCTL_PROXY: JSON.stringify(
          {
            routes,
github SplitmediaLabsLimited / devctl / src / utils / dockerCompose.js View on Github external
async function getLastComposeFile() {
  const exists = await filesystem.exists(lastDCPath);

  if (!exists) {
    return null;
  }

  return filesystem.read(lastDCPath);
}