Skip to content

Commit e1080ab

Browse files
Semih KEŞKEKSemih KEŞKEK
authored andcommitted
Watch Sites Directory
1 parent 2f8f2ba commit e1080ab

File tree

3 files changed

+22
-0
lines changed

3 files changed

+22
-0
lines changed

App.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import {Directory} from './App/Configuration';
2+
import {SitesWatcher} from './App/DirectoryListener';
3+
4+
var siteW = new SitesWatcher(Directory.SitePath)

App/Configuration.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
var Directory = {
2+
SitePath: './Sites'
3+
}
4+
5+
6+
7+
export {Directory};

App/DirectoryListener.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/// <reference path="../typings/index.d.ts" />
2+
import * as File from 'fs';
3+
4+
export class SitesWatcher{
5+
constructor(path){
6+
var ths: Object = this;
7+
File.watch(path, (event, filename) => {
8+
console.log(event + ' =>' + filename);
9+
});
10+
}
11+
}

0 commit comments

Comments
 (0)