nadesiko3 3.3.23 → 3.3.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nadesiko3",
3
- "version": "3.3.23",
3
+ "version": "3.3.24",
4
4
  "description": "Japanese Programming Language",
5
5
  "main": "src/index.mjs",
6
6
  "bin": {
@@ -21,11 +21,6 @@ const userDir = path.join(homeDir, 'nadesiko3_user')
21
21
  const CNAKO3 = path.resolve(path.join(__dirname, '../../src/cnako3.mjs'))
22
22
  const NODE = process.argv[0]
23
23
 
24
- // ライブラリがあるかチェック
25
- if (!fs.existsSync(path.resolve(rootDir, 'extlib/pure.min.css'))) {
26
- execSync('npm run extlib:install')
27
- }
28
-
29
24
  // サーバ
30
25
  const server = http.createServer(function (req, res) {
31
26
  console.log('[ようこそ]', JSON.stringify(req.url))
@@ -170,6 +165,7 @@ function apiSave (res, params) {
170
165
  res.end('error')
171
166
  }
172
167
  }
168
+
173
169
  function apiRun (res, params) {
174
170
  const fname = params.file
175
171
  const body = params.body
@@ -177,7 +173,13 @@ function apiRun (res, params) {
177
173
  try {
178
174
  fs.writeFileSync(fullpath, body, 'utf-8')
179
175
  const cmd = `"${NODE}" "${CNAKO3}" "${fullpath}"`
180
- const result = execSync(cmd)
176
+ let result = ''
177
+ try {
178
+ result = execSync(cmd)
179
+ result = String(result)
180
+ } catch (err) {
181
+ console.error(err)
182
+ }
181
183
  console.log('[run] file=', fname)
182
184
  console.log('--------------------------------')
183
185
  console.log(result)