rl-rock 1.3.5 → 1.3.7

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/dist/index.js CHANGED
@@ -2388,9 +2388,10 @@ var Sandbox = class extends AbstractSandbox {
2388
2388
  const objectName = `download-${timestamp}-${fileName}`;
2389
2389
  const credentials = await this.getOssStsCredentials();
2390
2390
  const bucketName = envVars.ROCK_OSS_BUCKET_NAME ?? "";
2391
- const region = envVars.ROCK_OSS_BUCKET_REGION ?? "";
2392
- const endpoint = `https://oss-${region}.aliyuncs.com`;
2393
- const uploadToOssCmd = `ossutil cp '${remotePath}' 'oss://${bucketName}/${objectName}' --access-key-id '${credentials.accessKeyId}' --access-key-secret '${credentials.accessKeySecret}' --sts-token '${credentials.securityToken}' --endpoint '${endpoint}' --region '${region}'`;
2391
+ const region = (envVars.ROCK_OSS_BUCKET_REGION ?? "").replace(/^oss-/, "");
2392
+ const endpoint = envVars.ROCK_OSS_BUCKET_ENDPOINT ?? `oss-${region}.aliyuncs.com`;
2393
+ const ossutilInnerCmd = `ossutil cp '${remotePath}' 'oss://${bucketName}/${objectName}' --access-key-id '${credentials.accessKeyId}' --access-key-secret '${credentials.accessKeySecret}' --sts-token '${credentials.securityToken}' --endpoint '${endpoint}' --region '${region}'`;
2394
+ const uploadToOssCmd = `bash -c '${ossutilInnerCmd.replace(/'/g, `'"'"'`)}'`;
2394
2395
  const uploadResult = await this.arun(uploadToOssCmd, { mode: "nohup", waitTimeout: 600 });
2395
2396
  if (uploadResult.exitCode !== 0) {
2396
2397
  return { success: false, message: `Sandbox to OSS upload failed: ${uploadResult.output}` };