-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: error on copy paste if key value has '='
Fixes #308 Fix error on copy-paste if key value has '='. * **apps/shelve/app/components/project/CreateVariables.vue** - Update `parseEnvFile` function to split only on the first '='. - Update `paste` event handler to split only on the first '='. * **apps/lp/app/components/vault/Encrypt.vue** - Update `saveEnvFile` function to split only on the first '='. * **apps/lp/app/components/vault/Decrypt.vue** - Update `decryptEnvFile` function to split only on the first '='. * **packages/cli/src/utils/env.ts** - Update `copyEnv` function to split only on the first '='. - Update `downloadEnv` function to split only on the first '='. * **apps/shelve/app/utils/clipboard.ts** - Update `copyToClipboard` function to split only on the first '='. --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/HugoRCD/shelve/issues/308?shareId=XXXX-XXXX-XXXX-XXXX).
- Loading branch information
Showing
5 changed files
with
48 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,12 @@ | ||
export function copyToClipboard(toCopy: string, message: string = 'Copied to clipboard') { | ||
navigator.clipboard.writeText(toCopy).then(() => { | ||
const lines = toCopy.split('\n').filter((line) => line.trim() !== '') | ||
const variables = lines.map((line) => { | ||
const [key, ...valueParts] = line.split('=') | ||
const value = valueParts.join('=') | ||
return `${key}=${value}` | ||
}) | ||
const formattedString = variables.join('\n') | ||
navigator.clipboard.writeText(formattedString).then(() => { | ||
toast.success(message) | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters