uni-run 1.1.21 → 1.1.23
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.
|
@@ -3,14 +3,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.getOutputFileName = getOutputFileName;
|
|
7
7
|
exports.getCacheDir = getCacheDir;
|
|
8
8
|
exports.cleanCacheDir = cleanCacheDir;
|
|
9
9
|
const path_1 = __importDefault(require("path"));
|
|
10
10
|
const utils_1 = require("../helpers/utils");
|
|
11
11
|
const cacheDir = path_1.default.join(__dirname, '../../.cache');
|
|
12
|
-
function
|
|
13
|
-
|
|
12
|
+
function getOutputFileName(slug) {
|
|
13
|
+
const ext = process.platform === 'win32' ? '.exe' : '';
|
|
14
|
+
const dir = (0, utils_1.emptyDir)(cacheDir, slug + '-' + `${process.pid}-${process.ppid}`);
|
|
15
|
+
return path_1.default.join(dir, 'output' + ext);
|
|
14
16
|
}
|
|
15
17
|
function getCacheDir() {
|
|
16
18
|
return cacheDir;
|
|
@@ -143,6 +143,16 @@ exports.default = (0, as_1.default)([
|
|
|
143
143
|
};
|
|
144
144
|
},
|
|
145
145
|
},
|
|
146
|
+
{
|
|
147
|
+
name: 'Dart',
|
|
148
|
+
exts: ['dart'],
|
|
149
|
+
getRuntime(args, options, config) {
|
|
150
|
+
return {
|
|
151
|
+
exec: ['dartvm', ...args],
|
|
152
|
+
installHints: ['Please install Dart from https://dart.dev'],
|
|
153
|
+
};
|
|
154
|
+
},
|
|
155
|
+
},
|
|
146
156
|
{
|
|
147
157
|
name: 'Powershell',
|
|
148
158
|
exts: ['ps1'],
|
|
@@ -221,7 +231,7 @@ exports.default = (0, as_1.default)([
|
|
|
221
231
|
name: 'C - GCC',
|
|
222
232
|
exts: ['c'],
|
|
223
233
|
getRuntime([script, ...args], options, config) {
|
|
224
|
-
const output = (0, helpers_1.
|
|
234
|
+
const output = (0, helpers_1.getOutputFileName)('/c-gcc');
|
|
225
235
|
return {
|
|
226
236
|
compile: ['gcc', script, '-o', output],
|
|
227
237
|
exec: [output, ...args],
|
|
@@ -233,7 +243,7 @@ exports.default = (0, as_1.default)([
|
|
|
233
243
|
name: 'C++ - GCC',
|
|
234
244
|
exts: ['cpp'],
|
|
235
245
|
getRuntime([script, ...args], options, config) {
|
|
236
|
-
const output = (0, helpers_1.
|
|
246
|
+
const output = (0, helpers_1.getOutputFileName)('/cpp-gcc');
|
|
237
247
|
return {
|
|
238
248
|
compile: ['g++', script, '-o', output],
|
|
239
249
|
exec: [output, ...args],
|
|
@@ -245,7 +255,7 @@ exports.default = (0, as_1.default)([
|
|
|
245
255
|
name: 'C# - Mono (Windows)',
|
|
246
256
|
exts: ['cs'],
|
|
247
257
|
getRuntime([script, ...args], options, config) {
|
|
248
|
-
const output = (0, helpers_1.
|
|
258
|
+
const output = (0, helpers_1.getOutputFileName)('/cs-mono');
|
|
249
259
|
return {
|
|
250
260
|
compile: ['mcs', '-out:' + output, script],
|
|
251
261
|
exec: [output, ...args],
|
|
@@ -257,7 +267,7 @@ exports.default = (0, as_1.default)([
|
|
|
257
267
|
name: 'Rust - rustc',
|
|
258
268
|
exts: ['rs'],
|
|
259
269
|
getRuntime([script, ...args], options, config) {
|
|
260
|
-
const output = (0, helpers_1.
|
|
270
|
+
const output = (0, helpers_1.getOutputFileName)('/rust-rustc');
|
|
261
271
|
return {
|
|
262
272
|
compile: ['rustc', script, '-o', output],
|
|
263
273
|
exec: [output, ...args],
|