Code Monkey home page Code Monkey logo

import-cli's Introduction

import-cli's People

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

import-cli's Issues

impossible to use additional vendor dirs with relative path

Hi!

Once I upgrade to 3.7.1 loading my custom modules didn't work any more. The import complained that it couldn't find the service.xml file any more. This is how I defined the additional vendor dirs in my custom techdivision-import.json:

  "additional-vendor-dirs": [
    {
      "vendor-dir": "app/code",
      "libraries": [
        "Client/PimCategoriesImport"
      ]
    }
  ],

Since we have a number of setups and the placement of the app/code directory is not always the same depending on the setup, I cannot specifiy an absolute directory for vendor-dir.

The problem is that when the XmlFileLoader is created in TechDivision\Import\Cli\Configuration\LibraryLoader on line 102

$customLoader = new XmlFileLoader($this->getContainer(), new FileLocator());

no path array is given to the FileLocator constructor. So necessarily all additional vendor dirs must be absolute.

At least the FileLocator should get the current working directory as path like this:

$customLoader = new XmlFileLoader($this->getContainer(), new FileLocator([getcwd()]));

Best and thanks,
Klaas

additional-vendor-dirs not working outside installation directory

Repro Steps

  1. Use an addional-vendor-dirs configuration for a module under <m2_root>/app/code/MyVendor/MyModule
  2. execute the import from a different location then m2_root
cd /tmp;
php /path/to/m2_root/vendor/bin/import-m2if import:products [...]

expected: Import is executed
actual: Exception with message Can't find find library directory "app/code/MyVendor/MyModule" is thrown

Information

  1. techdivision/import-cli/src/Configuration/LibraryLoader.php:113 does not evaluate the configured installation-dir. The following code seems to fix it:
===================================================================
--- src/Configuration/LibraryLoader.php	(date 1586968263997)
+++ src/Configuration/LibraryLoader.php	(date 1586968263997)
@@ -110,7 +110,7 @@
 
             // try to load the DI configuration for the configured extension libraries
             foreach ($additionalVendorDir->getLibraries() as $library) {
-                if ($libraryDir = realpath(sprintf('%s/%s', $additionalVendorDir->getVendorDir(), $library))) {
+                if ($libraryDir = realpath(sprintf('%s/%s/%s', $configuration->getInstallationDir(), $additionalVendorDir->getVendorDir(), $library))) {
                     $this->loadConfiguration($customLoader, $magentoVersion, $libraryDir);
                 } else {
                     throw new \Exception(

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.