Skip to content

Commit

Permalink
chore: fix ESLINT warnings of undefined variables @msagi
Browse files Browse the repository at this point in the history
  • Loading branch information
JamieSlome committed Apr 12, 2024
1 parent 1e2677e commit d6d2c91
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions packages/git-proxy-cli/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ const util = require('util');
const GIT_PROXY_COOKIE_FILE = 'git-proxy-cookie';
// GitProxy UI HOST and PORT (configurable via environment variable)
const { GIT_PROXY_UI_HOST: uiHost = 'http://localhost' } = process.env;
const { GIT_PROXY_UI_PORT: uiPort } =
require('@finos/git-proxy/src/config/env').Vars;
const { GIT_PROXY_UI_PORT: uiPort } = require('@finos/git-proxy/src/config/env').Vars;
const baseUrl = `${uiHost}:${uiPort}`;

axios.defaults.timeout = 30000;
Expand Down Expand Up @@ -151,11 +150,11 @@ async function authoriseGitPush(id) {
try {
const cookies = JSON.parse(fs.readFileSync(GIT_PROXY_COOKIE_FILE, 'utf8'));

response = await axios.get(`${baseUrl}/api/v1/push/${id}`, {
await axios.get(`${baseUrl}/api/v1/push/${id}`, {
headers: { Cookie: cookies },
});

response = await axios.post(
await axios.post(
`${baseUrl}/api/v1/push/${id}/authorise`,
{},
{
Expand Down Expand Up @@ -198,11 +197,11 @@ async function rejectGitPush(id) {
try {
const cookies = JSON.parse(fs.readFileSync(GIT_PROXY_COOKIE_FILE, 'utf8'));

response = await axios.get(`${baseUrl}/api/v1/push/${id}`, {
await axios.get(`${baseUrl}/api/v1/push/${id}`, {
headers: { Cookie: cookies },
});

response = await axios.post(
await axios.post(
`${baseUrl}/api/v1/push/${id}/reject`,
{},
{
Expand Down Expand Up @@ -245,11 +244,11 @@ async function cancelGitPush(id) {
try {
const cookies = JSON.parse(fs.readFileSync(GIT_PROXY_COOKIE_FILE, 'utf8'));

response = await axios.get(`${baseUrl}/api/v1/push/${id}`, {
await axios.get(`${baseUrl}/api/v1/push/${id}`, {
headers: { Cookie: cookies },
});

response = await axios.post(
await axios.post(
`${baseUrl}/api/v1/push/${id}/cancel`,
{},
{
Expand Down Expand Up @@ -284,13 +283,11 @@ async function cancelGitPush(id) {
async function logout() {
if (fs.existsSync(GIT_PROXY_COOKIE_FILE)) {
try {
const cookies = JSON.parse(
fs.readFileSync(GIT_PROXY_COOKIE_FILE, 'utf8'),
);
const cookies = JSON.parse(fs.readFileSync(GIT_PROXY_COOKIE_FILE, 'utf8'));
fs.writeFileSync(GIT_PROXY_COOKIE_FILE, '*** logged out ***', 'utf8');
fs.unlinkSync(GIT_PROXY_COOKIE_FILE);

response = await axios.post(
await axios.post(
`${baseUrl}/auth/logout`,
{},
{
Expand Down

0 comments on commit d6d2c91

Please sign in to comment.