L
L
Leshrac2014-04-16 13:39:11
Continuous Integration
Leshrac, 2014-04-16 13:39:11

How to get the path to the directory where the package was installed via bower?

I put the necessary packages through bower .
To run tests, I need to get the full path to the directory where this package was installed.
On Travis, for example, $TRAVIS_BUILD_DIR is used to get the path to the build dir.
Is there anything similar in bower (I did not find a way through the Programmatic API)?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
Leshrac, 2014-04-21
@Leshrac

The task was solved by using GruntJS .
In my case, I needed the path to SpecRunner.html from jasmine in order to run the tests.
Thanks to the grant (and the grunt-contrib-jasmine plugin ), the necessary paths (sources, specs, helpers) can be set once - only in the grant file:

jasmine: {
    pivotal: {
      src: 'src/**/*.js',
      options: {
        specs: 'spec/*Spec.js',
        helpers: 'spec/*Helper.js'
      }
    }
  }

To include libraries downloaded via bower in html , you can use the grunt-bower-install grant plugin .
Alternatively, getting the path from .bowerrc and bower.json can be used :
pkg: grunt.file.readJSON('.bowerrc'),
build: {
        src: 'src/<%= pkg.directory %>.js'
      }

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question