mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 02:35:49 +00:00
feature: package: @putout/plugin-cloudcmd v2.0.0: CloudCmd.loadDir() -> CloudCmd.changeDir()'
This commit is contained in:
parent
026c292bae
commit
e28215ddf3
8 changed files with 25 additions and 63 deletions
|
|
@ -719,9 +719,7 @@ module.exports.goToDirectory = async () => {
|
|||
if (cancel)
|
||||
return;
|
||||
|
||||
await CloudCmd.loadDir({
|
||||
path,
|
||||
});
|
||||
await CloudCmd.changeDir(path);
|
||||
};
|
||||
|
||||
module.exports.duplicatePanel = async () => {
|
||||
|
|
@ -739,8 +737,7 @@ module.exports.duplicatePanel = async () => {
|
|||
|
||||
const path = getPath(isDir);
|
||||
|
||||
await CloudCmd.loadDir({
|
||||
path,
|
||||
await CloudCmd.changeDir(path, {
|
||||
panel,
|
||||
noCurrent,
|
||||
});
|
||||
|
|
@ -760,14 +757,12 @@ module.exports.swapPanels = async () => {
|
|||
|
||||
let currentIndex = files.indexOf(element);
|
||||
|
||||
await CloudCmd.loadDir({
|
||||
path,
|
||||
await CloudCmd.changeDir(path, {
|
||||
panel: panelPassive,
|
||||
noCurrent: true,
|
||||
});
|
||||
|
||||
await CloudCmd.loadDir({
|
||||
path: dirPathPassive,
|
||||
await CloudCmd.changeDir(dirPathPassive, {
|
||||
panel,
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -11,10 +11,10 @@ global.CloudCmd = {};
|
|||
test('cloudcmd: client: dom: goToDirectory', async (t) => {
|
||||
const path = '';
|
||||
const {CloudCmd} = global;
|
||||
const loadDir = stub();
|
||||
const changeDir = stub();
|
||||
const prompt = stub().returns([null, path]);
|
||||
|
||||
CloudCmd.loadDir = loadDir;
|
||||
CloudCmd.changeDir = changeDir;
|
||||
|
||||
mockRequire('./dialog', {
|
||||
prompt,
|
||||
|
|
@ -26,7 +26,7 @@ test('cloudcmd: client: dom: goToDirectory', async (t) => {
|
|||
|
||||
stopAll();
|
||||
|
||||
t.calledWith(loadDir, [{path}]);
|
||||
t.calledWith(changeDir, [path]);
|
||||
t.end();
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue