Skip to content

Commit

Permalink
feature: Autoprefixer added
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeMitterer committed Apr 8, 2015
1 parent 519d685 commit 62c6541
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
6 changes: 6 additions & 0 deletions SiteGen.iml
Expand Up @@ -4,6 +4,12 @@
<exclude-output />
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/bin/packages" />
<excludeFolder url="file://$MODULE_DIR$/example/packages" />
<excludeFolder url="file://$MODULE_DIR$/example/simple/.sitegen/packages" />
<excludeFolder url="file://$MODULE_DIR$/example/simple/html/_content/about/packages" />
<excludeFolder url="file://$MODULE_DIR$/example/simple/html/_content/packages" />
<excludeFolder url="file://$MODULE_DIR$/example/simple/html/_templates/packages" />
<excludeFolder url="file://$MODULE_DIR$/example/simple/html/packages" />
<excludeFolder url="file://$MODULE_DIR$/example/simple/web/about/packages" />
<excludeFolder url="file://$MODULE_DIR$/example/simple/web/packages" />
<excludeFolder url="file://$MODULE_DIR$/example/simple/web/styles/packages" />
Expand Down
16 changes: 16 additions & 0 deletions lib/src/Application.dart
Expand Up @@ -143,6 +143,7 @@ class Application {

_logger.info("Main SCSS: $scssFile");
_compileScss(config.sasscompiler,scssFile, cssFile);
_autoPrefixer("autoprefixer",cssFile);

scssFiles.forEach((final File file) {
_logger.info("Observing: ${file.path}");
Expand All @@ -152,6 +153,7 @@ class Application {
//_logger.info("Scss: ${scssFile}, CSS: ${cssFile}");

_compileScss(config.sasscompiler, scssFile, cssFile);
_autoPrefixer("autoprefixer",cssFile);
});
});

Expand Down Expand Up @@ -278,6 +280,20 @@ class Application {
_logger.info("Done!");
}

Future _autoPrefixer(final String prefixer,final String cssFile) async {
Validate.notBlank(prefixer);
Validate.notBlank(cssFile);

_logger.info("Autoprefixing $cssFile");
final ProcessResult result = await Process.run(prefixer, [ cssFile ]);
if (result.exitCode != 0) {
_logger.info("prefixer faild with: ${(result.stderr as String).trim()}!");
_vickiSay("got a prefixer error");
return;
}
_logger.info("Done!");
}

List<File> _listSCSSFilesIn(final Directory dir) {
Validate.notNull(dir);
return dir.listSync(recursive: true).where((final file) {
Expand Down

0 comments on commit 62c6541

Please sign in to comment.