UNPKG

@ordino.ai/cli

Version:
19 lines (18 loc) 800 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.createEnvFile = createEnvFile; var _path = _interopRequireDefault(require("path")); var _fs = _interopRequireDefault(require("fs")); function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; } function createEnvFile(appPath, apiKey, projectId, ordinoURL) { var envFilePath = _path["default"].join(appPath, ".env"); var envContent = "ORDINO_KEY=".concat(apiKey, "\nPROJECT_ID=").concat(projectId, "\nORDINO_URL=").concat(ordinoURL); if (_fs["default"].existsSync(envFilePath)) { console.log(".env file already exists, skipping creation."); } else { _fs["default"].writeFileSync(envFilePath, envContent, "utf8"); console.log(".env file created successfully."); } }