Exemple #1
0
        public bool Repair(PackageFile file, bool force = false)
        {
            var upk    = file.CreateSourcePackage();
            var reader = new SourceReader(Log, upk, this);

            if (force || !reader.CacheExists ||
                reader.HasAnythingChangedSince(reader.CacheTime, false))
            {
                Log.Verbose("Generating cache for " + file.Name);
                using (new FileLock(Log, file.CacheDirectory))
                    reader.ExportCache(file.CacheDirectory);
                return(true);
            }

            return(false);
        }
        public bool Repair(PackageFile file, bool force = false)
        {
            var upk    = file.CreateSourcePackage();
            var reader = new SourceReader(Log, upk, this);

            // Install NPM packages if package.json exists
            if (NPM.NeedsInstall(upk))
            {
                new NPM(Log).Install(upk);
            }

            if (force || !reader.CacheExists ||
                reader.HasAnythingChangedSince(reader.CacheTime, false))
            {
                Log.Verbose("Generating cache for " + file.Name);
                using (new FileLock(file.CacheDirectory))
                    reader.ExportCache(file.CacheDirectory);
                return(true);
            }

            return(false);
        }