Skip to content

Commit

Permalink
Merge pull request #34 from desktop/remove-unused-env-vars
Browse files Browse the repository at this point in the history
Remove unused env vars
  • Loading branch information
niik authored Jun 3, 2024
2 parents f7b91a1 + d38f3fb commit ac8a04f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
4 changes: 1 addition & 3 deletions src/desktop-trampoline.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,10 @@ if (writeSocket(socket, dataString, strlen(dataString) + 1) != 0) { \

// This is a list of valid environment variables that GitHub Desktop might
// send or expect to receive.
#define NUMBER_OF_VALID_ENV_VARS 4
#define NUMBER_OF_VALID_ENV_VARS 2
static const char *sValidEnvVars[NUMBER_OF_VALID_ENV_VARS] = {
"DESKTOP_TRAMPOLINE_IDENTIFIER",
"DESKTOP_TRAMPOLINE_TOKEN",
"DESKTOP_USERNAME",
"DESKTOP_ENDPOINT",
};

/** Returns 1 if a given env variable is valid, 0 otherwise. */
Expand Down
5 changes: 1 addition & 4 deletions test/desktop-trampoline.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ describe('desktop-trampoline', () => {
const env = {
DESKTOP_TRAMPOLINE_IDENTIFIER: '123456',
DESKTOP_PORT: port,
DESKTOP_USERNAME: 'sergiou87',
DESKTOP_USERNAME_FAKE: 'fake-user',
INVALID_VARIABLE: 'foo bar',
}
const opts = { env }
Expand All @@ -57,9 +55,8 @@ describe('desktop-trampoline', () => {
expect(outputArguments).toStrictEqual(['baz'])
// output[2] is the number of env variables
const outputEnv = output.slice(3)
expect(outputEnv).toHaveLength(2)
expect(outputEnv).toHaveLength(1)
expect(outputEnv).toContain('DESKTOP_TRAMPOLINE_IDENTIFIER=123456')
expect(outputEnv).toContain(`DESKTOP_USERNAME=sergiou87`)

server.close()
})
Expand Down

0 comments on commit ac8a04f

Please sign in to comment.