Skip to content

Commit d3c16b7

Browse files
authored
sed for real (#17)
1 parent 78e1f2e commit d3c16b7

File tree

7 files changed

+1772
-645
lines changed

7 files changed

+1772
-645
lines changed

src/agent-examples/multi-file-migration.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,9 @@ const winston = require('winston');
197197
const env = createEnv();
198198

199199
// Convert a simple require to import (escape parens for regex)
200+
// Use -E for ERE mode where \( and \) are literal parentheses
200201
await env.exec(
201-
"sed \"s/const express = require\\('express'\\);/import express from 'express';/g\" /project/src/index.js > /project/src/index.js.new",
202+
"sed -E \"s/const express = require\\('express'\\);/import express from 'express';/g\" /project/src/index.js > /project/src/index.js.new",
202203
);
203204
await env.exec("mv /project/src/index.js.new /project/src/index.js");
204205

0 commit comments

Comments
 (0)