File tree Expand file tree Collapse file tree 4 files changed +13
-4
lines changed
Expand file tree Collapse file tree 4 files changed +13
-4
lines changed Original file line number Diff line number Diff line change 1- import { config } from "../lib/config" ;
21import { getFileSystemRepo } from "../lib/get-file-system-repo" ;
32import { getQiitaApiInstance } from "../lib/get-qiita-api-instance" ;
43import { getUrlAddress } from "../lib/getUrlAddress" ;
@@ -23,6 +22,6 @@ export const preview = async () => {
2322
2423 startLocalChangeWatcher ( {
2524 server,
26- watchPath : config . getItemsRootDir ( ) ,
25+ watchPath : fileSystemRepo . getRootPath ( ) ,
2726 } ) ;
2827} ;
Original file line number Diff line number Diff line change @@ -401,4 +401,12 @@ updated
401401 } ) ;
402402 } ) ;
403403 } ) ;
404+
405+ describe ( "getRootPath()" , ( ) => {
406+ it ( "returns the root path" , ( ) => {
407+ const dataRootDir = "./tmp" ;
408+ const instance = new FileSystemRepo ( { dataRootDir } ) ;
409+ expect ( instance . getRootPath ( ) ) . toBe ( `tmp/public` ) ;
410+ } ) ;
411+ } ) ;
404412} ) ;
Original file line number Diff line number Diff line change @@ -187,7 +187,7 @@ export class FileSystemRepo {
187187 await fs . mkdir ( this . getRemotePath ( ) , { recursive : true } ) ;
188188 }
189189
190- private getRootPath ( ) {
190+ public getRootPath ( ) {
191191 const subdir = "public" ;
192192 return path . join ( this . dataRootDir , subdir ) ;
193193 }
Original file line number Diff line number Diff line change @@ -65,7 +65,9 @@ export function startLocalChangeWatcher({
6565 watchPath : string ;
6666} ) {
6767 const wsServer = new WebSocketServer ( { server } ) ;
68- const watcher = chokidar . watch ( watchPath ) ;
68+ const watcher = chokidar . watch ( watchPath , {
69+ ignored : [ "**/.remote/**" ] ,
70+ } ) ;
6971 watcher . on ( "change" , ( ) => {
7072 wsServer . clients . forEach ( ( client ) => {
7173 if ( client . readyState === WebSocket . OPEN ) {
You can’t perform that action at this time.
0 commit comments