Skip to content

Commit

Permalink
Merge pull request #38 from Samsung/wits-vscode
Browse files Browse the repository at this point in the history
resource zip에 canon 파일 다운로드 추가
  • Loading branch information
pwsses authored May 26, 2020
2 parents b9f1d66 + 2a9d135 commit dda7f00
Show file tree
Hide file tree
Showing 11 changed files with 67 additions and 269 deletions.
11 changes: 0 additions & 11 deletions .witsconfig.json

This file was deleted.

Binary file modified archive/resource.zip
Binary file not shown.
7 changes: 3 additions & 4 deletions command/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ module.exports = {
makeWitsignoreFile();
makeWitsconfigFile();

console.log(``);
console.log(`\nStart downloading files for configuration...`);

await Promise.all([
prepareTool(CONTAINER_NAME, CONTAINER_ZIP_URL),
Expand Down Expand Up @@ -77,7 +77,7 @@ function makeWitsconfigFile() {
console.log('.witsconfig.json is already exist.');
return;
}
util.createEmptyFile(WITSCONFIG_PATH);
util.createEmptyFile(WITSCONFIG_PATH, '{}');
console.log('.witsconfig.json is prepared.');
} catch (error) {
console.error(`Failed to makeWitsconfigFile ${error}`);
Expand Down Expand Up @@ -125,15 +125,14 @@ async function download(name, downloadUrl) {

if (getFileSize(ZIP_FILE_PATH) === 0) {
util.removeFile(ZIP_FILE_PATH);
console.log(`Invalid zip file was successfully removed.\n`);
}

const optionalInfo = await userInfoHelper.getOptionalInfo();
const zip = fs.createWriteStream(ZIP_FILE_PATH);

await new Promise((resolve, reject) => {
let requestOptions = { uri: downloadUrl };
if (util.isPropertyExist(optionalInfo, 'proxyServer')) {
if (optionalInfo && util.isPropertyExist(optionalInfo, 'proxyServer')) {
requestOptions = {
uri: downloadUrl,
strictSSL: false,
Expand Down
7 changes: 7 additions & 0 deletions command/start.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,17 @@ const appLaunchHelper = require('../lib/appLaunchHelper.js');
const watchHelper = require('../lib/watchHelper.js');

const CONTAINER_DIRECTORY_NAME = 'container';
const RESOURCE_DIRECTORY_NAME = 'resource';
const CONTAINER_DIRECTORY_PATH = path.join(
util.WITS_BASE_PATH,
'../',
CONTAINER_DIRECTORY_NAME
);
const RESOURCE_DIRECTORY_PATH = path.join(
util.WITS_BASE_PATH,
'../',
RESOURCE_DIRECTORY_NAME
);

module.exports = {
run: async () => {
Expand Down Expand Up @@ -69,6 +75,7 @@ module.exports = {
function checkConfiguration() {
if (
!util.isFileExist(CONTAINER_DIRECTORY_PATH) ||
!util.isFileExist(RESOURCE_DIRECTORY_PATH) ||
!util.isFileExist(util.TOOLS_CRYPT_PATH) ||
!util.isFileExist(util.TOOLS_SDB_PATH)
) {
Expand Down
42 changes: 22 additions & 20 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,34 +1,36 @@
const initCommand = require('./command/init.js');
const watchCommand = require('./command/watch.js');
const startCommand = require('./command/start.js');
const userInfoHelper = require('./lib/userInfoHelper');

const setWitsconfigInfo = data => {
const setWitsconfigInfo = async data => {
const initCommand = require('./command/init.js');
console.log('WITs::setWitsconfigInfo');
initCommand.prepareRun();
userInfoHelper.updateLatestUserAnswer(data);

await initCommand.prepareRun();
await userInfoHelper.updateLatestUserAnswer(data);
return;
/**
{
width: '1920',
deviceIp: '192.168.250.250',
socketPort: 8498, (optional)
hostIp: '192.168.250.250',
baseAppPath: 'E:/dev/workspace/test',
isDebugMode: false,
profilePath: 'C:/tizen-studio-data/profile/profiles.xml',
{
width: '1920',
deviceIp: '192.168.250.250',
socketPort: 8498, (optional)
hostIp: '192.168.250.250',
baseAppPath: 'E:/dev/workspace/test',
isDebugMode: false,
profilePath: 'C:/tizen-studio-data/profile/profiles.xml',
}
*/
*/
};

const start = () => {
const start = async () => {
const startCommand = require('./command/start.js');
console.log('WITs::start');
startCommand.run();
await startCommand.run();
return;
};

const watch = () => {
const watch = async () => {
const watchCommand = require('./command/watch.js');
console.log('WITs::watch');
watchCommand.run();
await watchCommand.run();
return;
};

module.exports = {
Expand Down
213 changes: 0 additions & 213 deletions lib/build/exclusive-canonicalization.js

This file was deleted.

14 changes: 12 additions & 2 deletions lib/build/signPackage.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,18 @@ const util = require('../util.js');

// 3rd packager tool, enter into 'xml-crypto' to support xml signature
const Dom = require('xmldom').DOMParser;
const ExclusiveCanonicalization = require('./exclusive-canonicalization')
.ExclusiveCanonicalization;
const CANON_PATH = path.join(
util.WITS_BASE_PATH,
'../',
'resource',
'exclusive-canonicalization.js'
);

let ExclusiveCanonicalization = null;
if (util.isFileExist(CANON_PATH)) {
ExclusiveCanonicalization = require('../../resource/exclusive-canonicalization')
.ExclusiveCanonicalization;
}

// Generated personal/public signature file
const AUTOR_SIGNATURE = path.join(
Expand Down
8 changes: 4 additions & 4 deletions lib/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,11 @@
const commander = require('commander');
const program = new commander.Command();

const initCommand = require('../command/init.js');
const startCommand = require('../command/start.js');
const watchCommand = require('../command/watch.js');
const watchHelper = require('./watchHelper.js');
const util = require('./util.js');

process.on('SIGINT', () => {
// ctrl + C
const watchHelper = require('./watchHelper.js');
watchHelper.closeSocketServer();
util.close();
});
Expand All @@ -22,10 +19,13 @@ program.option('-w, --watch', 'Watch project for live reloading');
program.parse(process.argv);

if (program.init) {
const initCommand = require('../command/init.js');
initCommand.run();
} else if (program.start) {
const startCommand = require('../command/start.js');
startCommand.run();
} else if (program.watch) {
const watchCommand = require('../command/watch.js');
watchCommand.run();
} else {
program.help();
Expand Down
Loading

0 comments on commit dda7f00

Please sign in to comment.