1
- using System . Collections . Generic ;
1
+ using System ;
2
+ using System . Collections . Generic ;
2
3
using System . IO ;
3
4
4
5
namespace WebCompiler
@@ -10,6 +11,15 @@ public override string[] SearchPatterns
10
11
get { return new [ ] { "*.scss" , "*.sass" } ; }
11
12
}
12
13
14
+ public override string FileExtension
15
+ {
16
+ get
17
+ {
18
+ return ".scss" ;
19
+ }
20
+ }
21
+
22
+
13
23
/// <summary>
14
24
/// Updates the dependencies of a single file
15
25
/// </summary>
@@ -28,7 +38,7 @@ public override void UpdateFileDependencies(string path)
28
38
//remove the dependentfile registration of this file for all other files
29
39
foreach ( var dependenciesPath in Dependencies . Keys )
30
40
{
31
- var lowerDependenciesPath = path . ToLowerInvariant ( ) ;
41
+ var lowerDependenciesPath = dependenciesPath . ToLowerInvariant ( ) ;
32
42
if ( Dependencies [ lowerDependenciesPath ] . DependentFiles . Contains ( path ) )
33
43
{
34
44
Dependencies [ lowerDependenciesPath ] . DependentFiles . Remove ( path ) ;
@@ -43,6 +53,12 @@ public override void UpdateFileDependencies(string path)
43
53
foreach ( System . Text . RegularExpressions . Match match in matches )
44
54
{
45
55
FileInfo importedfile = new FileInfo ( Path . Combine ( info . DirectoryName , match . Groups [ 3 ] . Value ) ) ;
56
+ //if the file doesn't end with the correct extension, an import statement without extension is probably used, to re-add the extension (#175)
57
+ if ( string . Compare ( importedfile . Extension , FileExtension , StringComparison . OrdinalIgnoreCase ) != 0 )
58
+ {
59
+ importedfile = new FileInfo ( importedfile . FullName + this . FileExtension ) ;
60
+ }
61
+
46
62
var dependencyFilePath = importedfile . FullName . ToLowerInvariant ( ) ;
47
63
48
64
if ( ! Dependencies [ path ] . DependentOn . Contains ( dependencyFilePath ) )
0 commit comments