How to change files stored by cycle.serve
Closed this issue · 1 comments
joaomilho commented
I need to apply some changes to files saved locally using cycle.serve. I see that serve creates a provisional request in the check
method:
let provReq = new ProvisionableRequest({
protocol: req.protocol,
proxy: upstreamProxy,
method: 'GET',
hostname: req.hostname,
port: req.port,
path: req.url,
})
provReq.send()
let mirrResp = yield provReq.receive()
And later on mirrResp
is written to the FS:
let writeToFile = fs.createWriteStream(file)
// ...
yield new Promise((resolve, reject) => {
mirrResp.pipe(writeToFile)
// ...
It seems to me that changes should be applied to the mirrResp
. Is my assumption correct?
greim commented
Mirroring only downloads once, so to change a file locally, you can just edit the saved file in your text editor.