mirror of
https://github.com/QuasarApp/CQtDeployer.git
synced 2025-05-08 15:39:35 +00:00
fix invoke of target dir
This commit is contained in:
parent
063ad8ffd7
commit
3206347da0
@ -58,7 +58,7 @@ bool Deploy::prepare() {
|
||||
|
||||
int Deploy::deploy() {
|
||||
|
||||
_fileManager->loadDeployemendFiles(_paramsParser->config()->targetDir);
|
||||
_fileManager->loadDeployemendFiles(_paramsParser->config()->getTargetDir());
|
||||
|
||||
switch (DeployCore::getMode() ) {
|
||||
case RunMode::Deploy:
|
||||
@ -70,7 +70,7 @@ int Deploy::deploy() {
|
||||
default:
|
||||
break;
|
||||
}
|
||||
_fileManager->saveDeploymendFiles(_paramsParser->config()->targetDir);
|
||||
_fileManager->saveDeploymendFiles(_paramsParser->config()->getTargetDir());
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -17,7 +17,7 @@ DeployConfig::getTargetsListByFilter(const QString &filter) {
|
||||
return result;
|
||||
}
|
||||
|
||||
QString DeployConfig::targetPath(const QString &target) {
|
||||
QString DeployConfig::getTargetDir(const QString &target) const {
|
||||
if (targets.contains(target))
|
||||
return targetDir + targets.value(target).getSufix();
|
||||
return targetDir;
|
||||
|
@ -28,12 +28,9 @@ struct DEPLOYSHARED_EXPORT Extra {
|
||||
|
||||
};
|
||||
|
||||
struct DEPLOYSHARED_EXPORT DeployConfig {
|
||||
/**
|
||||
* @brief targetDir - targe directory (this folder conteins all files of distrebution kit)
|
||||
*/
|
||||
QString targetDir = "";
|
||||
class DEPLOYSHARED_EXPORT DeployConfig {
|
||||
|
||||
public:
|
||||
/**
|
||||
* @brief depchLimit - recursive search limit
|
||||
*/
|
||||
@ -89,9 +86,18 @@ struct DEPLOYSHARED_EXPORT DeployConfig {
|
||||
/**
|
||||
* @brief targetPath
|
||||
* @param target
|
||||
* @return pathe to folder with target
|
||||
* @return path to deployement root dir of target.
|
||||
* If target value well be empty then return main root of all targets.
|
||||
*/
|
||||
QString targetPath(const QString& target);
|
||||
QString getTargetDir(const QString& target = "") const;
|
||||
|
||||
private:
|
||||
|
||||
/**
|
||||
* @brief targetDir - targe directory (this folder conteins all files of distrebution kit)
|
||||
*/
|
||||
QString targetDir = "";
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
@ -208,7 +208,7 @@ bool FileManager::removeFile(const QString &file) {
|
||||
bool FileManager::smartCopyFile(const QString &file, const QString &target, QStringList *mask) {
|
||||
auto config = DeployCore::_config;
|
||||
|
||||
if (file.contains(config->targetDir)) {
|
||||
if (file.contains(config->getTargetDir())) {
|
||||
if (!moveFile(file, target, mask)) {
|
||||
QuasarAppUtils::Params::verboseLog(" file not moved! try copy");
|
||||
|
||||
|
@ -37,7 +37,7 @@ bool MetaFileManager::createRunScriptWindows(const QString &target) {
|
||||
content = content.arg(QFileInfo(target).fileName()).arg("%*");
|
||||
content = QDir::toNativeSeparators(content);
|
||||
|
||||
QString fname = DeployCore::_config->targetDir + QDir::separator() + QFileInfo(target).baseName()+ ".bat";
|
||||
QString fname = DeployCore::_config->getTargetDir(target) + QDir::separator() + QFileInfo(target).baseName()+ ".bat";
|
||||
|
||||
QFile F(fname);
|
||||
if (!F.open(QIODevice::WriteOnly)) {
|
||||
@ -92,7 +92,7 @@ bool MetaFileManager::createRunScriptLinux(const QString &target) {
|
||||
content = content.arg("");
|
||||
}
|
||||
|
||||
QString fname = DeployCore::_config->targetDir + QDir::separator() + QFileInfo(target).baseName()+ ".sh";
|
||||
QString fname = DeployCore::_config->getTargetDir(target) + QDir::separator() + QFileInfo(target).baseName()+ ".sh";
|
||||
|
||||
QFile F(fname);
|
||||
if (!F.open(QIODevice::WriteOnly)) {
|
||||
@ -156,7 +156,7 @@ bool MetaFileManager::createQConf(const QString &target) {
|
||||
content.replace("//", "/");
|
||||
content = QDir::fromNativeSeparators(content);
|
||||
|
||||
QString fname = DeployCore::_config->targetDir + distro.getBinOutDir() + "qt.conf";
|
||||
QString fname = DeployCore::_config->getTargetDir(target) + distro.getBinOutDir() + "qt.conf";
|
||||
|
||||
QFile F(fname);
|
||||
if (!F.open(QIODevice::WriteOnly)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user