Compare commits

...

5 Commits

Author SHA1 Message Date
Simos Mikelatos
9d7d12742f Merge branch 'main' into feature/restart-server-on-update 2026-04-14 17:18:33 +02:00
Haileyesus
1a0f10217d feat: simplify update commands for platform 2026-04-14 16:34:05 +03:00
Haileyesus
f8d1a0dd2c feat: optimize platform update command by omitting dev dependencies 2026-04-14 15:59:06 +03:00
Haileyesus
78c1d35a5d feat: add update platform script to package.json 2026-04-14 15:32:04 +03:00
Haileyesus
906997391d feat: support restart server on update for platform 2026-04-14 15:30:23 +03:00
3 changed files with 20 additions and 8 deletions

View File

@@ -35,7 +35,8 @@
"release": "./release.sh",
"prepublishOnly": "npm run build",
"postinstall": "node scripts/fix-node-pty.js",
"prepare": "husky"
"prepare": "husky",
"update:platform": "./update-platform.sh"
},
"keywords": [
"claude code",

View File

@@ -435,13 +435,20 @@ app.post('/api/system/update', authenticateToken, async (req, res) => {
console.log('Starting system update from directory:', projectRoot);
// Run the update command based on install mode
const updateCommand = installMode === 'git'
? 'git checkout main && git pull && npm install'
: 'npm install -g @cloudcli-ai/cloudcli@latest';
// Platform deployments use their own update workflow from the project root.
const updateCommand = IS_PLATFORM
// In platform, husky and dev dependencies are not needed
? 'npm run update:platform'
: installMode === 'git'
? 'git checkout main && git pull && npm install'
: 'npm install -g @cloudcli-ai/cloudcli@latest';
const updateCwd = IS_PLATFORM || installMode === 'git'
? projectRoot
: os.homedir();
const child = spawn('sh', ['-c', updateCommand], {
cwd: installMode === 'git' ? projectRoot : os.homedir(),
cwd: updateCwd,
env: process.env
});

View File

@@ -4,6 +4,7 @@ import { authenticatedFetch } from "../../../utils/api";
import { ReleaseInfo } from "../../../types/sharedTypes";
import { copyTextToClipboard } from "../../../utils/clipboard";
import type { InstallMode } from "../../../hooks/useVersionCheck";
import { IS_PLATFORM } from "../../../constants/config";
interface VersionUpgradeModalProps {
isOpen: boolean;
@@ -25,7 +26,9 @@ export function VersionUpgradeModal({
const { t } = useTranslation('common');
const upgradeCommand = installMode === 'npm'
? t('versionUpdate.npmUpgradeCommand')
: 'git checkout main && git pull && npm install';
: IS_PLATFORM
? 'npm run update:platform'
: 'git checkout main && git pull && npm install';
const [isUpdating, setIsUpdating] = useState(false);
const [updateOutput, setUpdateOutput] = useState('');
const [updateError, setUpdateError] = useState('');
@@ -46,7 +49,8 @@ export function VersionUpgradeModal({
if (response.ok) {
setUpdateOutput(prev => prev + data.output + '\n');
setUpdateOutput(prev => prev + '\n✅ Update completed successfully!\n');
setUpdateOutput(prev => prev + 'Please restart the server to apply changes.\n');
const text = IS_PLATFORM ? 'Please refresh the page after 5 seconds to load the new version. If that doesn\'t work, RESTART the environment.' : 'Please restart the server to apply changes.';
setUpdateOutput(prev => prev + text + '\n');
} else {
setUpdateError(data.error || 'Update failed');
setUpdateOutput(prev => prev + '\n❌ Update failed: ' + (data.error || 'Unknown error') + '\n');