Skip to content

Commit

Permalink
fix: if running as a snap app, $HOME is not the real home
Browse files Browse the repository at this point in the history
  • Loading branch information
james-hu committed Jul 14, 2023
1 parent fe36236 commit 7c51959
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions bin/apig-swagger-ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@

process.env.AWS_SDK_JS_SUPPRESS_MAINTENANCE_MODE_MESSAGE='1';

// if running as a snap app, $HOME is not the real home
if (process.env.SNAP_REAL_HOME && process.env.SNAP_REAL_HOME !== process.env.HOME) {
if (!process.env.AWS_SDK_LOAD_CONFIG) {
process.env.AWS_SDK_LOAD_CONFIG = '1';
}
if (!process.env.AWS_CONFIG_FILE) {
process.env.AWS_CONFIG_FILE = `${process.env.SNAP_REAL_HOME}/.aws/config`;
}
if (!process.env.AWS_SHARED_CREDENTIALS_FILE) {
process.env.AWS_SHARED_CREDENTIALS_FILE = `${process.env.SNAP_REAL_HOME}/.aws/credentials`;
}
}

const path = require('path')
const oclif = require('@oclif/core')

Expand Down

0 comments on commit 7c51959

Please sign in to comment.