c# - How do I install bower packages using Cake (http://cakebuild.net) -


i working on migrating powershell build script cake script , have run following on collection of directories bower.json files found:

foreach ($directory in (get-commonpath $bowerdirs)) {     push-location $directory     &bower install     pop-location } 

but since there doesn't seem cake alias bower i'm struggling work out how should (&bower install) using cake.

update based on @garyewanpark's answer tried following

task("bowerinstall")   .does(() => {     var bowerroots = getbowerroots();     foreach (var bowerroot in bowerroots.select(x => x.fullpath))     {       try        {         var exitcodewithargument = startprocess("bower", new processsettings {           arguments = "install",           workingdirectory = bowerroot         });         information("exit code: {0}", exitcodewithargument);       }       catch (exception ex)       {         information($"failed on {bowerroot}, {ex.message}");       }     }   }); 

but gave following error message each path attempted

failed on c:/projects/dev/webui, system cannot find file specified

if running bower install in directory using command prompt runs successfully

the directory structure running in described below. there multiple solutions within single git branch. each solution can contain multiple projects , have bower.json file. getbowerroots() method returns directorypathcollection of directories contain bower.json file.

c:\   - projects     - branch       - build.ps1       - build.cake       - sol1         - proj1           - misc proj files           - bower.json       - sol2         - proj2           - misc proj files           - bower.json 

a cake.bower addin has been created, , available download here:

https://www.nuget.org/packages/cake.bower/


Comments

Popular posts from this blog

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

python Tkinter Capturing keyboard events save as one single string -

sql server - Why does Linq-to-SQL add unnecessary COUNT()? -