mirror of
https://github.com/Kong/insomnia
synced 2024-11-08 06:39:48 +00:00
Support importing raw string and naming the import
This commit is contained in:
parent
973f31e1f1
commit
ae803c5c5f
@ -50,7 +50,8 @@ export async function importUri(
|
|||||||
const path = uri.replace(/^(file):\/\//, '');
|
const path = uri.replace(/^(file):\/\//, '');
|
||||||
rawText = fs.readFileSync(path, 'utf8');
|
rawText = fs.readFileSync(path, 'utf8');
|
||||||
} else {
|
} else {
|
||||||
throw new Error(`Invalid import URI ${uri}`);
|
// Treat everything else as raw text
|
||||||
|
rawText = decodeURIComponent(uri);
|
||||||
}
|
}
|
||||||
|
|
||||||
const result = await importRaw(getWorkspaceId, rawText);
|
const result = await importRaw(getWorkspaceId, rawText);
|
||||||
|
@ -103,7 +103,7 @@ export function newCommand(command, args) {
|
|||||||
title: 'Confirm Data Import',
|
title: 'Confirm Data Import',
|
||||||
message: (
|
message: (
|
||||||
<span>
|
<span>
|
||||||
Do you really want to import <code>{args.uri}</code>?
|
Do you really want to import <code>{args.name || args.uri}</code>?
|
||||||
</span>
|
</span>
|
||||||
),
|
),
|
||||||
addCancel: true,
|
addCancel: true,
|
||||||
|
Loading…
Reference in New Issue
Block a user