@@ -18,6 +18,7 @@ const MAX_REQUEST_ALLOWED_TIME = 5 * 60 * 1000;
1818const loggerLabel = 'project-sync-service' ;
1919let remoteBaseCommitId = '' ;
2020let WM_PLATFORM_VERSION = '' ;
21+ let IS_AI_PLATFORM = false ;
2122
2223async function findProjectId ( config ) {
2324 const projectList = ( await axios . get ( `${ config . baseUrl } /edn-services/rest/users/projects/list` ,
@@ -28,6 +29,7 @@ async function findProjectId(config) {
2829 . filter ( p => ( config . appPreviewUrl . endsWith ( p . name + "_" + p . vcsBranchId ) ) ) ;
2930 if ( project && project . length ) {
3031 WM_PLATFORM_VERSION = project [ 0 ] . platformVersion ;
32+ IS_AI_PLATFORM = / \. w a v e m a k e r \. a i / . test ( config . baseUrl ) ;
3133 return project [ 0 ] . studioProjectId ;
3234 }
3335}
@@ -54,7 +56,7 @@ async function downloadProject(projectId, config, projectDir) {
5456 taskLogger . start ( previewSteps [ 2 ] . start ) ;
5557 taskLogger . setTotal ( previewSteps [ 2 ] . total )
5658 const tempFile = `${ os . tmpdir ( ) } /changes_${ Date . now ( ) } .zip` ;
57- if ( semver . lt ( WM_PLATFORM_VERSION , '11.4.0' ) ) {
59+ if ( semver . lt ( WM_PLATFORM_VERSION , '11.4.0' ) && ! IS_AI_PLATFORM ) {
5860 const res = await axios . get ( `${ config . baseUrl } /studio/services/projects/${ projectId } /vcs/gitInit` , {
5961 responseType : 'stream' ,
6062 headers : {
@@ -150,7 +152,7 @@ async function pullChanges(projectId, config, projectDir) {
150152 logger . debug ( { label : loggerLabel , message : 'HEAD commit id is ' + headCommitId } ) ;
151153 taskLogger . start ( 'pulling new changes from studio...' ) ;
152154 const tempDir = path . join ( `${ os . tmpdir ( ) } ` , `changes_${ Date . now ( ) } ` ) ;
153- if ( semver . lt ( WM_PLATFORM_VERSION , '11.4.0' ) ) {
155+ if ( semver . lt ( WM_PLATFORM_VERSION , '11.4.0' ) && ! IS_AI_PLATFORM ) {
154156 const tempFile = `${ os . tmpdir ( ) } /changes_${ Date . now ( ) } .zip` ;
155157 console . log ( tempFile ) ;
156158 const res = await axios . get ( `${ config . baseUrl } /studio/services/projects/${ projectId } /vcs/remoteChanges?headCommitId=${ headCommitId } ` , {
0 commit comments