We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ac6fed9 commit 18c8190Copy full SHA for 18c8190
library-solidity/tasks/utils/loadVariables.ts
@@ -1,8 +1,11 @@
1
-// Get the required environment variable, throw an error if it's not set
2
-// We only check if the variable is set, not if it's empty
+// Get the required environment variable, throw an error if it's not set or empty
3
export function getRequiredEnvVar(name: string): string {
4
if (!(name in process.env)) {
5
throw new Error(`"${name}" env variable is not set`);
6
}
7
- return process.env[name]!;
+ const value = process.env[name]!;
+ if (value.trim() === '') {
8
+ throw new Error(`"${name}" env variable is set but empty`);
9
+ }
10
+ return value;
11
0 commit comments