improved file push to cloudshell

This commit is contained in:
Damien Caro 2018-01-02 12:36:02 -08:00
Родитель e2cf86cc5d
Коммит 56ea653183
1 изменённых файлов: 6 добавлений и 4 удалений

Просмотреть файл

@ -172,11 +172,13 @@ export class CloudShell extends BaseShell {
console.log(`Uploading file ${file} to cloud shell as ${path.relative(vscode.workspace.rootPath, file)}`)
const data = fsExtra.readFileSync(file, { encoding: 'utf8' }).toString();
// this.csTerm.ws.send('mkdir -p ' + path.relative(vscode.workspace.rootPath, path.dirname(file)) + ' \n');
this.csTerm.ws.send('mkdir -p ' + path.relative(vscode.workspace.rootPath, path.dirname(file))
+ ' && ' +
'echo -e "' + escapeFile(data) + '" > ./' + path.relative(vscode.workspace.rootPath, file) + ' \n');
this.csTerm.ws.send('mkdir -p ' + path.relative(vscode.workspace.rootPath, path.dirname(file))
+ ' ; ' +
'echo -e "' + escapeFile(data) + '" > ./' + path.relative(vscode.workspace.rootPath, file) + ' \n', function() {
console.log("File send to CloudShell");
});
};
}
}
catch (err) {
console.log(err)
}