rigjs 2.0.0-alpha.18 → 2.0.0-alpha.21

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.
@@ -1,6 +1,7 @@
1
1
  import aliOSS from 'ali-oss';
2
2
  import fs from 'fs';
3
3
  import { DeployTarget } from '../CICD';
4
+ import os from 'os';
4
5
  class AliOSS {
5
6
  ossClient: aliOSS;
6
7
  constructor(target: DeployTarget) {
@@ -25,10 +26,16 @@ class AliOSS {
25
26
  public async putStreamFiles(
26
27
  filesList: string[],
27
28
  ossBasePath: string,
28
- dir: string
29
+ dir: string,
30
+ rootPath: string
29
31
  ) {
30
32
  for (let i = 0; i < filesList.length; i++) {
31
- const filePath = filesList[i].split('dist\\')[1];
33
+ let filePath = '';
34
+ if (os.platform() === 'win32') {
35
+ filePath = filesList[i].split(`${rootPath}\\`)[1];
36
+ } else {
37
+ filePath = filesList[i].split(`${rootPath}/`)[1];
38
+ }
32
39
  const ossPath =
33
40
  ossBasePath + filePath.replace(/\\/g, '/').replace(dir, '');
34
41
 
@@ -27,7 +27,7 @@ export default async (cmd: any) => {
27
27
  const cicd = CICD.createByDefault(cmd);
28
28
  //construct cmd object
29
29
  const cicdCmd = new CICDCmd(cmd, cicd);
30
- console.log('cicdCmd:', cicdCmd);
30
+ console.log('cicdCmd:', cicdCmd.endpoints);
31
31
 
32
32
  const target = Array.isArray(cicdCmd.cicd.target)
33
33
  ? cicdCmd.cicd.target[0]
@@ -45,7 +45,8 @@ export default async (cmd: any) => {
45
45
  await aliOss.putStreamFiles(
46
46
  filesList,
47
47
  cicdCmd.endpoints[i].deployDir.replace(/\\/g, '/'),
48
- cicdCmd.endpoints[i].dir
48
+ cicdCmd.endpoints[i].dir,
49
+ cicd.source.root_path,
49
50
  );
50
51
  filesList = [];
51
52
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rigjs",
3
- "version": "2.0.0-alpha.18",
3
+ "version": "2.0.0-alpha.21",
4
4
  "description": "A multi-repos dev tool based on yarn and git.Rig is inspired by cocoapods. Not like those monorepo solutions,rig is a tool for organizing multi-repos.",
5
5
  "keywords": [
6
6
  "modular",