Doug Lauder
2023-03-22 17:22:27 -04:00
коммит произвёл GitHub
родитель b61c096497
Коммит c943ed6859
13276 изменённых файлов: 1695615 добавлений и 223189 удалений

30
e2e/cypress/tests/plugins/shell.js Обычный файл
Просмотреть файл

@@ -0,0 +1,30 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
const extractZip = require('extract-zip');
const shell = require('shelljs');
const shellFind = ({path, pattern}) => {
return shell.find(path).filter((file) => {
return file.match(pattern);
});
};
const shellRm = ({option, file}) => {
return shell.rm(option, file);
};
const shellUnzip = async ({source, target}) => {
try {
await extractZip(source, {dir: target});
return null;
} catch (err) {
return err;
}
};
module.exports = {
shellFind,
shellRm,
shellUnzip,
};