mirror of
https://github.com/Kong/insomnia
synced 2024-11-07 22:30:15 +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):\/\//, '');
|
||||
rawText = fs.readFileSync(path, 'utf8');
|
||||
} else {
|
||||
throw new Error(`Invalid import URI ${uri}`);
|
||||
// Treat everything else as raw text
|
||||
rawText = decodeURIComponent(uri);
|
||||
}
|
||||
|
||||
const result = await importRaw(getWorkspaceId, rawText);
|
||||
|
@ -103,7 +103,7 @@ export function newCommand(command, args) {
|
||||
title: 'Confirm Data Import',
|
||||
message: (
|
||||
<span>
|
||||
Do you really want to import <code>{args.uri}</code>?
|
||||
Do you really want to import <code>{args.name || args.uri}</code>?
|
||||
</span>
|
||||
),
|
||||
addCancel: true,
|
||||
|
Loading…
Reference in New Issue
Block a user