Beispiel #1
0
        private static void BowerDocumentHandler(Document document, OutputWindowWriter windowWriter)
        {
            if (document.IsBowerUpdateDisabled())
            {
                return;
            }

            _hasBowerInstalled = _hasBowerInstalled ? _hasBowerInstalled : NodePackageUtils.HasBowerOnPath();

            if (!_hasBowerInstalled)
            {
                windowWriter.Show();
                windowWriter.WriteLine(
                    "Bower Installation not detected. Run npm install bower -g to install if Node.js/NPM already installed.");
                return;
            }
            document.TryBowerInstall(windowWriter);
        }
Beispiel #2
0
        public static void HandleBowerPackageUpdate(this Document document, OutputWindowWriter windowWriter)
        {
            string path = document.GetProjectPath();

            //If bower.json and is at the root of the project
            if (document.Name.EqualsIgnoreCase("bower.json") && document.Path.EqualsIgnoreCase(path))
            {
                if (document.IsBowerUpdateDisabled())
                {
                    return;
                }

                hasBowerInstalled = hasBowerInstalled ? hasBowerInstalled : NodePackageUtils.HasBowerOnPath();

                if (!hasBowerInstalled)
                {
                    windowWriter.Show();
                    windowWriter.WriteLine("Bower Installation not detected. Run npm install bower -g to install if Node.js/NPM already installed.");
                    return;
                }
                document.TryBowerInstall(windowWriter);
            }
        }