Skip to content

Commit

Permalink
fix: path to save .apimockrc file
Browse files Browse the repository at this point in the history
  • Loading branch information
MHCYR committed Oct 5, 2023
1 parent c03a42e commit d859692
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
import { input, confirm } from "@inquirer/prompts";
import * as fs from "node:fs";
import OpenApiMocker from "open-api-mocker";
import path from "path";
import { fileURLToPath } from "url";
import cloneGitRepository from "./services/clone-git-repository.js";
import findOasFromDir from "./services/find-oas-from-dir.js";

const __filename = fileURLToPath(import.meta.url);

const __dirname = path.dirname(__filename);
const testRepoSSH = "git@gitlab.sngular.com:os3/manatee/sirenia.git";
const testRepoHTTPS = "https://gitlab.sngular.com/os3/manatee/sirenia.git"; // TODO: replace by user input

const main = async () => {
const config = {
Expand All @@ -23,7 +20,7 @@ const main = async () => {
console.table(config);

if (config.saveConfig) {
const filePath = `${__dirname}/.apimockrc`;
const filePath = `${process.cwd()}/.apimockrc`;
fs.writeFile(filePath, JSON.stringify(config), (err) => {
if (err) {
console.error(err);
Expand All @@ -33,11 +30,9 @@ const main = async () => {
});
}

const testRepoSSH = "git@gitlab.sngular.com:os3/manatee/sirenia.git"; // TODO: replace by user input
const testRepoHTTPS = "https://gitlab.sngular.com/os3/manatee/sirenia.git"; // TODO: replace by user input
await cloneGitRepository(config.repoUrl || testRepoSSH);

const schemas = await findOasFromDir('./tests');
const schemas = await findOasFromDir("./tests");

const openApiMocker = new OpenApiMocker({
port: 5000,
Expand Down

0 comments on commit d859692

Please # to comment.