Support importing raw string and naming the import

This commit is contained in:
Gregory Schier 2020-02-12 14:01:51 -05:00
parent 973f31e1f1
commit ae803c5c5f
2 changed files with 3 additions and 2 deletions

View File

@ -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);

View File

@ -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,